欢迎来到代码驿站!

jquery

当前位置:首页 > 网页前端 > jquery

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

时间:2021-06-14 09:42:59|栏目:jquery|点击:

复制代码 代码如下:

       <script src="Jquery1.7.js" type="text/javascript"></script>
    <script src="jquery.validate.js" type="text/javascript"></script>
    <script src="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="" id="form1">
         <table>
             <tr>
                <td>用户名:</td>
                <td><input name="txtUser" type="text" /><span>*</span> </td>
              </tr>

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

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

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

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

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

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

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

上一篇:jQuery实现切换隐藏与显示同时切换图标功能

栏    目:jquery

下一篇:jQuery实现右下角可缩放大小的层完整实例

本文标题:jQuery ui插件的使用方法代码实例

本文地址:http://www.codeinn.net/misctech/141444.html

推荐教程

广告投放 | 联系我们 | 版权申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:914707363 | 邮箱:codeinn#126.com(#换成@)

Copyright © 2020 代码驿站 版权所有