views:

26

answers:

2

Hi, 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?

+2  A: 

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 :)

Patricia
Thanks Patricia :)
Lobsterm
Your welcome :)
Patricia
+2  A: 

just remove function () in .validate(function () { and that should work...

Reigel
Thank you ! It worked.
Lobsterm