Closed Bug 403896 Opened 17 years ago Closed 17 years ago

Select box loses foxus on first item on refresh if several value fields identical

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 201056

People

(Reporter: stephen.adam, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9

When i refresh a page with a select box the wrong item is selected (i.e. not the one with 'selected="selected"', after playing around a bit I foudn it has something to do with having option tags with identical values. I've included a proof of concept below. 

Load the page and "select a quick link" is selected, on refesh the bottom most item is selected. 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD>

 <BODY>
  <select id="dllQuickLink"  >
					<option value="index.aspx" selected="selected">Select a quicklink</option>
					<option value="index.aspx">------------------------</option>
					<option value="/a/index.aspx">Mortgage Products</option>
					<option value="/ab/index.aspx">Tracker Mortgage</option>
					<option value="index.aspx">------------------------</option>
				</select>
 </BODY>
</HTML>


Reproducible: Always

Steps to Reproduce:
Refresh the page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD>

 <BODY>
  <select id="dllQuickLink"  >
					<option value="index.aspx" selected="selected">Select a quicklink</option>
					<option value="index.aspx">------------------------</option>
					<option value="/a/index.aspx">Mortgage Products</option>
					<option value="/ab/index.aspx">Tracker Mortgage</option>
					<option value="index.aspx">------------------------</option>
				</select>
 </BODY>
</HTML>

Actual Results:  
The correct option box lost focus

Expected Results:  
right option selcted
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
Attached file reporter's testcase
(with some cruft removed)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: