Bug Tracker

Modify

Ticket #4702 (closed bug: worksforme)

Opened 5 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

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();

Change History

comment:1 Changed 5 years ago by erangalp

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

comment:2 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to worksforme

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.