1. 程式人生 > >easyui驗證兩次密碼一致

easyui驗證兩次密碼一致

 $.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="兩次輸入密碼不匹配"/>