Bug Tracker

Modify

Ticket #6988 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

val(['option1', 'option2']) don't work in <select multiple="multiple"> if <option> have attribute value="value"

Reported by: miwol Owned by:
Priority: undecided Milestone: 1.4.3
Component: attributes Version: 1.4.2
Keywords: select miltiple val Cc:
Blocking: Blocked by:

Description

I found a problem with <select multiple="multiple"> and val(). $('select').val(['option1', 'option2']) work correct with <option>option1</option>. When a write <option value="1">option1</option> then jQuery select nothing. $('select').val([1, 2]) select nothing too.

Attachments

test.2.html Download (1.0 KB) - added by miwol 3 years ago.
test.html Download (1.0 KB) - added by miwol 3 years ago.

Change History

Changed 3 years ago by miwol

Changed 3 years ago by miwol

comment:1 Changed 3 years ago by dmethvin

  • Priority set to undecided

Further discussion, suggested patch, refutation of bug:

 http://github.com/jquery/jquery/pull/30

comment:2 Changed 3 years ago by snover

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

This is working properly according to the spec. Additional changes were made in 1.4.3 to improve the selection of current values from selects.

Last edited 3 years ago by snover (previous) (diff)

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.