Closed Bug 216253 Opened 23 years ago Closed 23 years ago

selected="selected" does not select option in select box

Categories

(Core :: Layout: Form Controls, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: spam, Unassigned)

References

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 when using selected="selected" for XHTML compatibility(generated by struts), the browser does not select the element as expected. This problem was present on mozilla 1.4 on windows XP, but not present on IE 6 on windows XP, or mozilla 1.3 on linux. Sample html snippet: <select name="gender"> <option value="m">Male</option> <option value="f" selected="selected">Female</option> </select> [results in male being selected, since it's the first option, instead of the desired result of female] Reproducible: Always Steps to Reproduce: 1. go to a web page with a form include the HTML snippet above and see if male or female is selected [female selected is the desired result] Actual Results: male is selected [since it is the first option] Expected Results: female is selected [since it has selected="selected"] <humor>So if this works, maybe I can find a female</humor>
I forgot to mention earlier that the most similar bug to this was number 203751, which sounds related.
Attached file Simple test case —
Attaching a simple test case. This appears to WFM in a recent nightly (2003081304 on Win2k) but somebody should test it in 1.4. If its wrong in 1.4 is it the sort of fix that should be applied to the (long-lived) 1.4 branch?
I downloaded mozilla 1.5a and the problem is not present in it on the same computer exhibiting the original problem.
Simple testcase wfm Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624
Simple testcase WFM in Mozilla/5.0 (OS/2; U; Warp 4.5; en-US; rv:1.4) Gecko/20030813
WFM in Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624
-> Form Controls
Assignee: mjudge → form
Component: Selection → Layout: Form Controls
QA Contact: pmac → ian
Simple testcase WFM in 1.5b, build 2003081515 on XP Pro SP2
Everyone appears confident that the simple test case works in both 1.4 and recent nightlies on a multitude of platforms. Can't see any significant difference between my simple test case and the reporter's code => will resolve as WFM. Reporter, if you think this is still a problem please indicate a URL where we can observe this problem, and (preferably) a cut-down test case.
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
*** Bug 237163 has been marked as a duplicate of this bug. ***
Firefox 42 WIN7 still have this problem. Setting witch option is to be selected in PHP, reflects in soruce code on page - but FF shows a previously user selected option, rather than the one, that is actually selected... Note it is not the first option that is displayed, but the one a user previously selected - atually think it show the selected value correctly first time around (but I can't really try that again now - it always comes out with the previous selected visible) - from there the shown selected is ruled by the user, not the code. Submitting a form, may actually submit a wrong value - or a correct; nobody knows! Quite useless actually. Definiately not solved, and not working properly.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: