Making validation with jquery-validate and Internet Explorer 6 work.

As a web developer, one of the more annoying things about forms is the validation part. Luckily there’s jquery-validate which makes validating forms as easy as just adding a simple class to an input field that needs validation.

However, during one of my latest projects I discovered that under certain conditions, jquery-validate doesn’t play nicely with Internet Explorer 6. By the time you will read this, things might have changed, but the issue I had was that no form validation was done at all.

After some Googling, it turned out the problem is caused by the fact that jquery-validate is encoded as ISO-8859-1. Since the page itself was using UTF-8, and Internet Explorer 6 seems to assume all scripts without a proper encoding defined must be using the same encoding as the page, this caused the validation to stop working.

The solution is simple however. You just need to change the line where jquery-validate is loaded :

<script src="jquery.validate.js" type="text/javascript"></script>

and add the proper encoding by adding charset=”iso-8859-1″ to the script tag :

<script src="jquery.validate.js" 
type="text/javascript" charset="iso-8859-1"></script>
Share or bookmark this article:
  • Digg
  • Google Bookmarks
  • del.icio.us
  • Facebook
  • Technorati
  • TwitThis
  • Yahoo! Buzz
  • email
  • Print
  • Reddit

3 Comments

  1. Andrey
    Posted November 4, 2009 at 10:21 | Permalink

    Thank you! It’s really help me!

  2. Posted November 9, 2009 at 03:48 | Permalink

    thank’s, it happen to me ^^

  3. Posted November 9, 2009 at 03:58 | Permalink

    thanks ^^

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 License