Skip to content

Instantly share code, notes, and snippets.

@SeonghoonKim
Created September 4, 2012 02:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeonghoonKim/3615811 to your computer and use it in GitHub Desktop.
Save SeonghoonKim/3615811 to your computer and use it in GitHub Desktop.
Bootstrap Form 에러 메시지 처리를 위한 jquery.validate 옵션 설정
// 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