easyui-validatebox 验证两次密码是否输入一致

验证两次密码是否输入一致

 $.extend($.fn.validatebox.defaults.rules, {
        /*必须和某个字段相等*/
        equalTo: { validator: function (value, param) { return $(param[0]).val() == value; }, message: '字段不匹配' }
       });

 

 密码: <input id="password" name="password" validType="length[4,32]" class="easyui-validatebox" required="true" type="password" value=""/><br/>
 确认密码:<input type="password" name="repassword" id="repassword" required="true" class="easyui-validatebox"  validType="equalTo['#password']" invalidMessage="两次输入密码不匹配"/>

posted @ 2015-02-04 15:45  StarkSoft  阅读(2949)  评论(0编辑  收藏  举报