jQuery validator annoyances

Null or Not an Object my ASS!

For all of you that use jQuery and use the Validator plugin, you may have been getting this error in Internet Explorer 6:

jQuery.Validator is null or not an object

This code will break any jQuery below your validation code, and will thoroughly piss you off.

The fix is simple: use the minified version (jquery.validate.min.js) javascript file, instead of the packed version (jquery.validate.pack.js).

This entry was posted in jQuery and tagged , , , , , , . Bookmark the permalink.
  • Mark

    This solution actually works. I’m having a different error but I suspect that its the jquery validator that is causing it.

    Lesson learned. “Smallest is not the best option”

  • http://zeepuertorico.com Ron Cansan

    Just pack it using another tool
    suggestion compressorrater thruhere net
    packer 3.1 alpha

  • Grant

    I actually had quite a few issues with this as well. The thing that worked for me was setting the charset of all of the jquery script files to charset=”ISO-8859-1″ and also using the validate.min.js . . . now it works like a charm in IE6 as well as in all others.

    I did it as follows:
    <script type="text/javascript" src="jquery.validate.min.js" charset="ISO-8859-1">

    Hope this helps someone avoid all of the same headaches I had.

  • Pingback: jQuery Validator Plugin and IE8 | Anuj Gakhar's Blog

  • codeho

    So i had the exact same problem in IE8 on windows 7,
    but none of the above stated solutions fixed this.
    what finally did fix it was that i had to change:
    $(‘#myformId’).validate({{………….
    after that it worked fine in all browsers.
    ch

  • Spencer

    That last comment was on the right track, but not very helpful for me. Turns out that I was getting this error because my form does not have an id. I added an id attribute to the form element, and the error disappeared. I believe that it is because the latest version of validate uses the jQuery data functionality and it doesn’t find the element to store the data in.

  • http://www.sean-o.com Sean O

    Changing from the ID of the form element: [$('#my-form').validate()] to simply: [$('form').validate()] eliminated IE Script Debugger errors for me.

    (jQuery v1.4.2, Validate plugin v1.7)

    –SEAN O

  • giappv

    Dear,

    I got validator is null. I tried many ways to fix this issue but unfortunately, it still happens.
    Would you like to help me?

    Regards
    Phil

  • http://www.hpicheckfree.co.uk hpi check free

    Does anyone know if fixing JQuery errors will improve SEO?

    I am clutching at straws now.

    I have a site which has an SEO score of 100% but still strugling for top 5 for main search term and before you say it, yes we do have lots of backlinks too. 45,000 in total.