Skip to content

Instantly share code, notes, and snippets.

@connected
Created February 8, 2014 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save connected/8884602 to your computer and use it in GitHub Desktop.
Save connected/8884602 to your computer and use it in GitHub Desktop.
jQuery from validation plugin default configuration for my projects
$.validator.setDefaults({
onkeyup: false,
errorElement: 'div',
errorPlacement: function(error, element) {
error
.addClass('message')
.insertAfter(element);
},
highlight: function(element, errorClass, validClass) {
$(element).parents('.field').addClass(errorClass);
}
});
$(document).ready(function(){
$("#commentForm").validate();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment