val() tries to set multiple values on single select lists
|Reported by:||bennettmcelwee||Owned by:|
jQuery.fn.val(value) will select every matching option in a select list, even if it's not a multiple select list. It's invalid HTML for more than one option to be selected. When it happens, the browser has to pick one to display. Firefox and Safari pick the first selected option; IE6 picks the last.
Correct behaviour should probably be to select just the first matching value in these cases.
I'm attaching a patch to attributes.js rev 6333 that fixes the problem, along with a simple test page that shows the problem on IE6.
Change History (6)
comment:1 Changed 5 years ago by dmethvin
- Keywords needsreview added
- Status changed from new to open