Skip to content

Commit c5eb471

Browse files
committed
Merge branch 'master' of github.com:victorjonsson/jQuery-Form-Validator
2 parents 7c8cb74 + e6c1ecc commit c5eb471

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

form-validator/jquery.form-validator.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@
111111
.bind('blur.validation', function() {
112112
$(this).validateInputOnBlur(language, settings, true, 'blur');
113113
});
114+
if(settings.validateCheckboxRadioOnClick) {
115+
// bind click event to validate on click for radio & checkboxes for nice UX
116+
this.find('input[type=checkbox][data-validation],input[type=radio][data-validation]')
117+
.bind('click.validation', function() {
118+
$(this).validateInputOnBlur(language, settings, true, 'click');
119+
});
120+
}
114121

115122
return this;
116123
};
@@ -522,6 +529,7 @@
522529
*/
523530
validateOnEvent : true,
524531
validateOnBlur : true,
532+
validateCheckboxRadioOnClick : true,
525533
showHelpOnFocus : true,
526534
addSuggestions : true,
527535
modules : '',

0 commit comments

Comments
 (0)