开发者

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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜