Jquery validation stopped working
here's my call to the validate function. Everything works fine 开发者_开发问答with this code.
$('#createForm').validate(function () {
});
But when I try to modify it a bit, the whole validation stop working:
$('#createForm').validate(function () {
errorPlacement: function(error, element) {
error.insertAfter(element);
},
debug:true
});
Any Idea?
you shouldn't have function() in there. change it to:
$('#createForm').validate(
{
errorPlacement: function(error, element) {
error.insertAfter(element);
},
debug:true
}
);
the stuff in the { } is the options. it's not a function :)
just remove function ()
in .validate(function () {
and that should work...
精彩评论