Closed Bug 283205 Opened 19 years ago Closed 19 years ago

<option value="something" selected> does not actually select option

Categories

(Firefox :: General, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 46845

People

(Reporter: rsoden, Assigned: bugzilla)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

This bug was posted earlier for the winXP version of Firefox1.0, but I have
found that the windows version WORKS and the OS X version DOES NOT.

When building a <select> form element with PHP's print() function, Firefox seems
to ignore the "selected" property within the subsequent <option> tags. It simply
defaults to the first <option> in the list.

I was not able to reproduce this error in the Win XP version of Firefox. IE also
displays the page correctly. It seems to be specific to the OS X version.

Reproducible: Always

Steps to Reproduce:
Execute the following PHP script:

<select name="mySelect">
<?php
  print("<option value=\"somevalue\">value 1</option>");
  print("<option value=\"othervalue\" selected>value 2</option>");
?>
</select>
Actual Results:  
"value 1" will be selected on page load instead of "value 2"


Expected Results:  
"value 2" should be selected as per the "selected" property in the  second
<option> tag.
Could I suggest that you establish a scrupulously exact recipe (and include
a complete testcase) to be sure that you are not seeing a Dup of Bug 46845 
"Form elements don't reset upon manually reloading page"?
Also check <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=257715">257715</a>
On mac os x 10.4.1, firefox 1.0.2, reproduce this bug by hitting reload with
this example web page:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>Test Selected on Reload</title>
</head>

<body>
    <select>
        <option>first</option>
        <option selected>second</option>
        <option>third</option>
    </select>
</body>
</html>
Attached file Reporter's Testcase
1. Open Page => shows 'second'
2. Select 'first'
3. Reload shows 'second', subsequent reloads alternate between 'first' and
'second'

A shift reload takes up back to 'second' (as expected).

This behaviour is an exact match of Bug 294258 "Reload clears form values, 
incorrectly", and this report is therefore a Dup of either that bug or 
(more resaonably) Bug 46845 "Form elements don't reset upon manually 
reloading page"

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

Attachment

General

Creator:
Created:
Updated:
Size: