Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 12:03:28 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155533 Posts in 21712 Topics by 7736 Members
Latest Member: chris85
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: jquery validate not working in IE - solution  (Read 3625 times)
PurpleEdge

Offline Offline

Posts: 232



WWW
« on: October 07, 2010, 08:31:13 AM »

I discovered today that one of my forms that uses jquery validation wasn't validating in Internet Explorer!

The validation worked fine when the form was used to insert a new record, but the submit button went straight to the next procedure when the same form was used to edit a record. It worked fine in Firefox.

After a couple of hours fiddling with the validation code, I narrowed the problem down to a SELECT control. I had formatted the select option as...

<select name="suburb" title="Your business must be located in one of these suburbs">
<option value = ''/>***NONE***
<option />AKUNA BAY
<option />ALLAMBIE
<option />ALLAMBIE HEIGHTS

IOW I hadn't specified a "VALUE" for each option - this completely broke the jquery validation for the whole form!

Changing the options to...

<select name="suburb" title="Your business must be located in one of these suburbs">
<option value = ''/>***NONE***
<option value='AKUNA BAY' />AKUNA BAY
<option value='ALLAMBIE' />ALLAMBIE
<option value='ALLAMBIE HEIGHTS' />ALLAMBIE HEIGHTS

...fixed it.

Thought I'd pass it on to others for possible future reference.
Logged
BerndJM

Offline Offline

Posts: 1764



« Reply #1 on: October 07, 2010, 10:46:29 AM »

Hi,

no idea where you've learned that coding wink
but I'll bet, if you use a correct html syntax it will even work in IE without the need of setting a value ...

Code:
<select name="top5" size="3">
      <option>Heino</option>
      <option>Michael Jackson</option>
      <option>Tom Waits</option>
      <option>Nina Hagen</option>
      <option>Marianne Rosenberg</option>
    </select>


Regards Bernd
Logged

In theory, there is no difference between theory and practice. But, in practice, there is.
PurpleEdge

Offline Offline

Posts: 232



WWW
« Reply #2 on: October 07, 2010, 01:30:37 PM »

Hi Bernd,

Nice thought, but unfortunately wrong  wink

It is the missing "value" that causes the error.

In HTML the option tag has no closing tag, but I guess it is time I started using xhtml  smiley

Regards,
Geoff B
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!