浏览代码

#390: Update enableFieldValidators() example

phuoc 11 年之前
父节点
当前提交
b7572a0739
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      demo/enable2.html

+ 4 - 0
demo/enable2.html

@@ -101,6 +101,10 @@ $(document).ready(function() {
         var isEmpty = $(this).val() == '';
         $('#signupForm').bootstrapValidator('enableFieldValidators', 'password', !isEmpty)
                         .bootstrapValidator('enableFieldValidators', 'confirm_password', !isEmpty);
+        if ($(this).val().length == 1) {
+            $('#signupForm').bootstrapValidator('validateField', 'password')
+                            .bootstrapValidator('validateField', 'confirm_password');
+        }
     });
 });
 </script>