Closed Bug 198189 Opened 21 years ago Closed 21 years ago

'selected' attribute not working for <option> elements (inside <select>s) when doing a refresh

Categories

(Core :: Layout: Form Controls, defect)

x86
Windows 2000
defect
Not set
minor

Tracking

()

VERIFIED DUPLICATE of bug 46845

People

(Reporter: ivars, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130

If you have <select> element with <option> elements inside and one/more/none of
those <option>s have 'selected' attribute, the page displays correctly.
If you change your HTML code to have some other <option>s to have 'selected'
attribute set and do a 'Refresh' in a browser, the page remains the same, i.e.
required <option> elements are not rendered preselected.

Reproducible: Always

Steps to Reproduce:
1. Create a HTML page with code like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1257">
</head>
<body>
<form name="form1" method="post" action="">
  <select name="select">
    <option value="0" selected>Please choose</option>
    <option value="1">One</option>
    <option value="2">Two</option>
    <option value="3">Three</option>
  </select>
</form>
</body>
</html>
2. Save the page and open it in a browser.
3. Now change the <option> elements to look like this:
    <option value="0">Please choose</option>
    <option value="1">One</option>
    <option value="2" selected>Two</option>
    <option value="3">Three</option>
4. Save the page and do a 'Refresh'
Actual Results:  
Select element still displays 'Please choose'. Page source, if viewed, is
correct and updated.

Expected Results:  
Have rendered option 'Two' as a preselected choice.

The bug is also there when <select> tag has 'size' and 'multiple' attributes.
Same as Bug 150414 which was marked as a Dupe of 46845 

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