Skip to main content

Bug Tracker

Side navigation

#4702 closed bug (worksforme)

Opened May 29, 2009 07:56PM UTC

Closed November 17, 2010 03:52AM UTC

The val() method on a select element works incorrectly in IE

Reported by: erangalp Owned by:
Priority: minor Milestone: 1.4
Component: core Version: 1.3.2
Keywords: select val Cc:
Blocked by: Blocking:
Description

When using the val() method on a SELECT element with a value in order to change the current selection, it fails when given an empty string. Suppose I have the following SELECT:

<select name="selectme">

<option value="">Select something...</option>

<option value="1" selected="selected">option 1</option>

<option value="2">option 2</option>

</select>

Using the following code will select the last option (instead of the first):

$("select[name='selectme']").val('');

Attachments (0)
Change History (2)

Changed May 29, 2009 07:57PM UTC by erangalp comment:1

I put two single quotes inside the val() method at the end. They were filtered out somehow

Changed November 17, 2010 03:52AM UTC by dmethvin comment:2

resolution: → worksforme
status: newclosed