jQuery Validate Plugin - Help me find my error.

Discussion in 'jQuery' started by crazyFoo, Jan 21, 2010.

  1. #1
    I've been working with the jQuery validate plugin lately. I love it. But I have a small error that I've been banging my head against and I haven't been able to figure out.

    My page is located at photo54 . com/freebridals/ (remove the spaces)

    I have several required fields, however, the phone number field is not required. But whenever someone clicks the submit button, it assigns it a 'valid' class. You'll notice that my other non-required fields do not do this.

    I simply can't figure this one out. Why is this only happening to my phone field?

    Any ideas from you jQuery geniuses?
     
    crazyFoo, Jan 21, 2010 IP
  2. crazyFoo

    crazyFoo Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I figured it out.

    If you put a maxlength attribute on the input tag, the jQuery validator will add the valid class if the length is shorter than the maxlength attribute.
     
    crazyFoo, Jan 22, 2010 IP