Created
September 4, 2012 02:20
-
-
Save SeonghoonKim/3615811 to your computer and use it in GitHub Desktop.
Bootstrap Form 에러 메시지 처리를 위한 jquery.validate 옵션 설정
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://twitter.github.com/bootstrap/base-css.html#forms | |
// http://docs.jquery.com/Plugins/Validation/Validator/setDefaults#defaults | |
// https://github.com/twitter/bootstrap/issues/202 | |
jQuery.validator.setDefaults({ | |
errorClass: 'help-inline', | |
errorElement: 'span', | |
highlight:function(element, errorClass, validClass) { | |
$(element).parents('.control-group').addClass('error'); | |
}, | |
unhighlight: function(element, errorClass, validClass) { | |
$(element).parents('.control-group').removeClass('error'); | |
$(element).parents('.control-group').addClass('success'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment