zl程序教程

您现在的位置是:首页 >  后端

当前栏目

jQueryui插件的使用方法代码实例

实例方法插件代码 使用 JQueryUI
2023-06-13 09:14:53 时间

复制代码代码如下:


      <scriptsrc="Jquery1.7.js"type="text/javascript"></script>
   <scriptsrc="jquery.validate.js"type="text/javascript"></script>
   <scriptsrc="messages_cn.js"type="text/javascript"></script>

   <scripttype="text/javascript">

       $(function(){

           $("#form1").validate({
               rules:{
                   txtUser:{required:true,minlength:6},
                   txtPassword:{required:true,minlength:6},
                   txtConfirm:{required:true,minlength:6,equalTo:"#password"},
                   txtHomePage:{required:true,url:true},
                   txtBirthday:{required:true,dateISO:true},
                   txtXueYa:{required:true,digits:true},
                   txtEmail:{required:true,email:true}
               },
               errorshow:function(error,element){
                   error.appendTo(element.siblings("span"));
               }
           })
       })

   </script>

</head>
<body>
   <formaction=""id="form1">
        <table>
            <tr>
               <td>用户名:</td>
               <td><inputname="txtUser"type="text"/><span>*</span></td>
             </tr>

             <tr>
                <td>密码:</td>
                 <td><inputname="txtPassword"id="password"type="text"/><span>*</span></td>
             </tr>

             <tr>
                <td>确认密码:</td>
                 <td><inputname="txtConfirm"type="text"/><span>*</span></td>
             </tr>

             <tr>
                  <td>主页:</td>
                   <td><inputname="txtHomePage"type="text"/><span>*</span></td>
             </tr>

             <tr>
               <td>生日:</td>
                <td><inputname="txtBirthday"type="text"/><span>*</span></td>
             </tr>

             <tr>
                <td>血压:</td>
                 <td><inputname="txtXueYa"type="text"/><span>*</span></td>
             </tr>

             <tr>
               <td>邮箱:</td>
               <td><inputname="txtEmail"type="text"/><span>*</span></td>
             </tr>
        </table>

   </form>
</body>
</html>