Skip to main content

Bug Tracker

Side navigation

#6988 closed bug (fixed)

Opened September 02, 2010 08:50AM UTC

Closed October 15, 2010 04:05AM UTC

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:
Blocked by: Blocking:
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 (2)
  • test.2.html (1.0 KB) - added by miwol September 02, 2010 08:54AM UTC.
  • test.html (1.0 KB) - added by miwol September 02, 2010 08:54AM UTC.
Change History (2)

Changed September 30, 2010 11:14PM UTC by dmethvin comment:1

priority: → undecided

Further discussion, suggested patch, refutation of bug:

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

Changed October 15, 2010 04:05AM UTC by snover comment:2

_comment0: This appears fixed in 1.4.3.1287115625384644
resolution: → fixed
status: newclosed

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.