2011-07-08

Uncaught TypeError: Cannot read property 'form' of undefined

In my code, that JavaScript error was caused by missing "name" attribute of an "input" tag, having jQuery.validation class "required".

For example:

input class="required" id="agree" type="checkbox" value="yes"
produces the error

input class="required" id="agree" type="checkbox" value="yes" name="agree"
works fine

2 comments:

  1. Thanks, my issue was similar except I was trying to call $('#someform_id').validate() and my form didn't have the right ID on it

    ReplyDelete
  2. Thanks! This just saved me some time. :-)

    ReplyDelete