waseem02 / jquery-asmselect

Automatically exported from code.google.com/p/jquery-asmselect
0 stars 0 forks source link

Default option requires a value #45

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
In IE8, if you are using a default value (via setting a title on the
select), the form won't be properly accepted without a value.

Specifically, in jquery.asmselect.js, there is a block of code that looks
like this:

// add a first option to be the home option / default selectLabel
$select.prepend("<option>" + $original.attr('title') + "</option>");

This gets munged if you try to serialize that in jquery without having a
value. It results in an "Object required" error.

The fix is easy, just give that option a value.

$select.prepend('<option value="foo">' + $original.attr('title') +
"</option>");

Original issue reported on code.google.com by rjb1...@gmail.com on 30 May 2010 at 8:39

GoogleCodeExporter commented 8 years ago

Original comment by ryancram...@gmail.com on 10 Jul 2010 at 3:33