Closed Bug 641944 Opened 13 years ago Closed 13 years ago

Hovered-over option gets incorrectly selected when originally selected option is disabled.

Categories

(Firefox :: General, defect)

3.6 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 387406

People

(Reporter: karlie.spambox+bugzilla, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15

If the currently selected option in a select is disabled, simply hovering over another options selects it - sort of.  Visually, it looks like the disabled option is still selected, but any form submission will send the incorrectly selected option.

This causes forms to submit with information different from what the user choose.  There has been no work-around found.

Here's some example html:

<select id="state">
<option value="-1" selected="selected" disabled="disabled">- Select a State -</option>
<option value="CA">CA</option>
<option value="CO">CO</option>
<option value="CN">CN</option>
</select>


And some example JavaScript:
var index = document.getElementById("state").selectedIndex;
alert(document.getElementById("state").options[index].text);

Reproducible: Always

Steps to Reproduce:
1. Open a page with the example html above.
2. Run the example javascript.  It will alert the value -1.
3. Click on the select element.
4. Hover over CO and then click somewhere else on the page.  The CO option should be the last option you hovered over before clicking somewhere else.


Actual Results:  
The select continues to appear as if the "Select a State" option is selected.  Run the example JavaScript.  The alerted value will be "CO".

Expected Results:  
The select continues to appear as if the "Select a State" option is selected.  Run the example JavaScript.  The alerted value will be "-1".

This has been reproduced on multiple machines running Firefox.  The same thing happens every time.
Whiteboard: dupeme
Version: unspecified → 3.6 Branch
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
Whiteboard: dupeme
You need to log in before you can comment on or make changes to this bug.