The minLength doesn't exist, its minlength. What happens is that an error as thrown, and instead of stopping the submit, it just submits. To debug issues like this, you can set debug:true - it'll then always prevent a submit, valid or not.
Jörn On Sun, Feb 15, 2009 at 1:24 AM, Mark <mnbaya...@gmail.com> wrote: > > If I leave all the fields blank, the errors show up as they should. > But if I correctly fill out even just one of them, the form gets > submitted. Why is this happening? > > Here's the JS: > > <script type="text/javascript"> > $(document).ready(function() { > $("form").validate({ > rules: { > email: { > required: true, > email: true > }, > fname: { > required: true, > minLength: 2 > }, > lname: { > required: true, > minLength: 2 > }, > city: { > required: true, > minLength: 2 > }, > password1: { > required: true, > minLength: 6 > }, > password2: { > equalTo: "#password1" > } > }, > messages: { > email: "*", > fname: "*", > lname: "*", > city: "*", > password1: "*", > password2: "*" > } > }); > }); > </script> > > The page is visible here: http://whitechocolateent.com/register >