我正在构建我的第一个ASP.net MVC应用程序(不是我的第一个jQuery和jQuery Validation插件应用程序),我正在用验证插件执行客户端验证的可怕时间.有没有人知道使用VS 2008附带的jQuery-1.3.2.min插件是否有问题?
我的代码如下:
var v = $("#frmAccount").validate({
rules: {
txtAccount: { minLength: 5,required: true },
txtFName: "required",
txtLName: "required"
},
message: {
txtAccount: {
required: "Account Number is required.",
minLength: jQuery.format("Account Number must be {0} or more charaters.")
},
txtFName: "First Name is required.",
txtLName: "Last Name is required.",
}
}); //validate
$("#cmd").click(function() {
if (v.form()) {
$("#frmAccount").submit();
}
});
Run Code Online (Sandbox Code Playgroud)
............................
<form method ="post"action ="/ Home/checkAccount"id ="frmAccount">
< fieldset>
<legend>帐户信息</ legend>
<p>
<br />
<label for ="txtAccount">帐号:</ label> …