.validator() required field in IE

Just a quick note, in IE, when working with jQuery Tools validator simply writing <input name=”name” type=”text” required> will not work as IE quite happily changes this to: <input name=”name” type=”text” required=””>.

To get required fields to work simply use required=”required” which does work.

About Simeon Cheeseman

I enjoy a wide variety of computer and board games, have a BSc in Computer Science and have played percussion for 18 years.

Posted on March 24, 2011, in HTML, jQuery, jQuery Tools. Bookmark the permalink. 4 Comments.

  1. But, in IE 9, I have:

    And it isnt required. It processes the form, if 2 or more fields are filled in, and I have 5 required fields, all specified as above.

  2. I can’t see what you have (seems something stripped it out) and without being able to see everything on that page it’s kinda hard to guess whats wrong. My suggestion is try to recreate the problem in a jsFiddle.net or plnkr.co, I’ve often found that just trying to recreate the issue somewhere else helps a lot – if it doesn’t, at least you’ve got an excellent demonstration for other people to look at to help you.

  3. Sorry,

    I have:

    <input type=”text” name=”FullName required=”required” />
    <input type=”email” name=”EmailAddr” required=”required” />
    <input type=”tel” name=”Phone” required=”required” />
    <input type=”url” name=”Domain” required=”required” />
    <input type=”number” min=”1″ name=”NumberOfUsers” required=”required” />

    For these 5 fields, as long as FullName and EmailAddr are filled in, it lets the form go through.

    I am trying to require all 5 fields be filled in before being allowed to move on.

    It works in Chrome, but not IE.

  4. Yea wordpress can be a pain for posting code, but it’s free (I’ve edited and consolidated your comments into one so it’s easier to read).
    As for your problem, checking here: http://jquerytools.org/documentation/validator/index.html#html5 states that “tel” isn’t one of the supported validation field types (You’ll have to create a custom validator for that). I don’t have an easily accessable IE9 browser until I can justify paying for a BrowserStack subscription, have a look at this: http://plnkr.co/edit/mpTEODFVl9MW6l8q1luN?p=preview, which is a slight modification of their demo. If that works just compare your setup to that one and tweak the differences till it works. If it doesn’t work for you I suggest you log a bug with jQueryTools as there isn’t much else I can think of; sorry.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: