<form id="loginForm" runat="server">
<table style=" width: 1000px;">
<tr>
<td style=" width: 20%; height: 30px;">用户名:</td>
<td style=" width: 70%;">
<asp:TextBox ID="txt_uname" runat="server"></asp:TextBox>
<span id="txt_unameTip"></span>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Button ID="btn_save" runat="server" Text="保 存" />
</td>
</tr>
</table>
</form>
<script type="text/javascript">
$.formValidator.initConfig({
formid: "loginForm",
onerror:function(msg){
alert(msg)
},
onsuccess:function(){
alert('success');
}
});
$("#txt_uname").formValidator(
{
onshow : "请输入用户名",
onfocus : "用户名至少6个字符,最多10个字符",
oncorrect: "该用户名可以注册"
}
).inputValidator(
{
min : 6,
max : 10,
onerror : "你输入的用户名非法,请确认"
}
).regexValidator(
{
regexp : "username",
datatype : "enum",
onerror : "用户名格式不正确"
}
);
</script>
好像没什么作用,什么原因呢