Created
February 8, 2014 14:31
-
-
Save connected/8884602 to your computer and use it in GitHub Desktop.
jQuery from validation plugin default configuration for my projects
This file contains hidden or 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
$.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