Closed Bug 273633 Opened 20 years ago Closed 20 years ago

<select> element can change selected value after reload if two <option>s have same value

Categories

(Core :: Layout: Form Controls, defect)

1.0 Branch
x86
All
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 201056

People

(Reporter: schickb, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

If two options in a <select> tag have the same "value" attribute and one of them
is the default "selected" option, Firefox will select the wrong option after a
fresh.

This is only happens when the non-selected tag comes after the selected tag (see
repro).

Reproducible: Always
Steps to Reproduce:
1. Navigate to the repro url or use this html
<html><body><select>
<option selected value="1">First Opt</option>
<option value="2">Second Opt</option>
<option value="3">Third Opt</option>
<option value="1">Fourth Opt</option>
</select></body></html>

2. Initially the "First Opt" text will be correctly selected
3. Click the Reload (aka refresh) button
4. After the reload, the "Fourth Opt" text will be selected

Actual Results:  
"Fourth Opt" is selected

Expected Results:  
"First Opt" is selected
Confirmed on PC/Linux with a 20041125 Firefox 1.0 CVS pull and an old Mozilla
1.7.3 20040919 CVS pull.

Changed summary.

Reassigning from product/component Mozilla/Form Manager to Core/Layout:Form
Controls.
Component: Form Manager → Layout: Form Controls
OS: Windows XP → All
Product: Firefox → Core
Summary: wrote select tag option displayed after refresh → <select> element can change selected value after reload if two <option>s have same value
Version: unspecified → 1.0 Branch
Assignee: bugs → nobody
Status: UNCONFIRMED → NEW
Ever confirmed: true
QA Contact: firefox.form-manager → core.layout.form-controls
*** Bug 254389 has been marked as a duplicate of this bug. ***

*** This bug has been marked as a duplicate of 201056 ***
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.