<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 : "你輸入的用戶名非法,請確認(rèn)" } ).regexValidator( { regexp : "username", datatype : "enum", onerror : "用戶名格式不正確" } ); </script>
?
好像沒什么作用,什么原因呢
formvalidator 問題
紅顏莎娜
2018-12-07 07:03:55