jQuery ui插件的使用方法代码实例


       <script src="https://www.jb51.net/Jquery1.7.js" type="text/javascript"></script>
    <script src="https://www.jb51.net/jquery.validate.js" type="text/javascript"></script>
    <script src="https://www.jb51.net/messages_cn.js" type="text/javascript"></script>

<script type="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>
    <form action="">
         <table>
             <tr>
                <td>用户名:</td>
                <td><input type="text" /><span>*</span> </td>
              </tr>

<tr>
                 <td>密码:</td>
                  <td><input type="text" /><span>*</span> </td>
              </tr>

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

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

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

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

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wdgjfs.html