WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.8 is now available!


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • jQuery »
  • jquery validate not working in IE - solution
  • Print
Pages: [1]   Go Down

Author Topic: jquery validate not working in IE - solution  (Read 25133 times)

Offline PurpleEdge

  • Posts: 231
  • Gender: Male
    • the northern beaches
jquery validate not working in IE - solution
« on: October 07, 2010, 09: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

Offline BerndJM

  • Posts: 1764
  • Gender: Male
Re: jquery validate not working in IE - solution
« Reply #1 on: October 07, 2010, 11:46:29 AM »
Hi,

no idea where you've learned that coding ;-)
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]
<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.

Offline PurpleEdge

  • Posts: 231
  • Gender: Male
    • the northern beaches
Re: jquery validate not working in IE - solution
« Reply #2 on: October 07, 2010, 02: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  :-)

Regards,
Geoff B
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • jQuery »
  • jquery validate not working in IE - solution
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2