Bug Tracker

Ticket #1474 (closed bug: fixed)

Opened 16 months ago

Last modified 15 months ago

setting selectedIndex doesn't update dropdown position

Reported by: eXcel Owned by:
Priority: minor Milestone: 1.2
Component: core Version: 1.1.3
Keywords: form dropdown selectedIndex attr Cc:
Needs: Review

Description

On my webpage, I noticed that if i did something like this

$('myDropdown').attr('selectedIndex',3);

the dropdown position would not change; however

alert($('myDropdown').attr('selectedIndex'));

prints 3

To see the correct behavior try something like this:

document.getElementById('myDropdown').selectedIndex = 3; 

which does change the dropdown position

use with

<form>
<select name="myDropdown" id="myDropdown">
<option value="a">a</option>
<option value="b">b</option>
<option value="c">c</option>
<option value="d">d</option>
<option value="e">e</option>
<option value="f">f</option>
</select>
</form>

Tested in Firefox 2.0.0.6

Change History

Changed 15 months ago by brandon

  • status changed from new to closed
  • resolution set to fixed

Fixed in SVN Rev: [3387]

Note: See TracTickets for help on using tickets.