我从http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/下载了这个 jquery 验证引擎
除了确认密码验证之外,所有验证都工作正常,无论密码是否匹配,它都会一直验证。
验证在单个页面上非常有效,但在母版页的内容页面中不起作用。
请帮我...
.aspx 文件
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script src="Styles/jquery-1.6.min.js" type="text/javascript"></script>
<script src="Styles/jquery.validationEngine-en.js" type="text/javascript"></script>
<script src="Styles/jquery.validationEngine.js" type="text/javascript"></script>
<link href="Styles/validationEngine.jquery.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
jQuery(document).ready(function () {
// binds form submission and fields to the validation engine
jQuery("#form1").validationEngine();
});
</script>
<form id="form1" runat="server">
<br />
<br />
<br />
<asp:TextBox ID="TextBox1" runat="server" class="validate[required] text-input"></asp:TextBox>
<br /><asp:TextBox ID="TextBox2" runat="server" class="validate[required,equals[TextBox1]] text-input"></asp:TextBox>
<br />
<asp:Button ID="Button1" runat="server" Text="Button" />
</form>
</asp:Content>