Closed Bug 12513 Opened 25 years ago Closed 25 years ago

HTMLSelectElement.options.selectedIndex not supported

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: cody, Assigned: pollmann)

References

Details

(Whiteboard: [PDT+] approved/reviewed fix in hand (will check in after bug 28691))

I tested one of my complex javascript programs using the Seamonkey 1999-9-25-13 (M10) nightly build on WinNT 4.0 SP 5. Moz can't identify the selected index in a select form field. Code snippet you can test. <Script Language="Javascript"> function foobar() { if (document.outputdebug.foobie.options.selectedIndex == 0) window.alert("BAM!"); } </script> <form name="outputdebug"><select name="foobie" size="3"> <option name="1">BAM </select> <input type="button" onClick="foobar();" value="DoIt"> </form> When I clicked on option 1 and hit the DoIt button, a "BAM!" alert should pop up (tested in ie5) but in this build, does nothing.
Component: Javascript Engine → DOM Level 0
QA Contact: cbegle → desale
wrong component
Assignee: mccabe → vidur
Reassigning to owner of DOM Level 0 (sorry, vidur.)
Summary: Form selection field selectedIndex not working properly → [4.xP]HTMLSelectElement.options.selectedIndex not supported
I would expect "document.outputdebug.foobie.selectedIndex" to work, but not with ".options" in the middle. For some reason, though, this does work in 4.x. How annoying. I guess this should be supported somehow. Changing title from "Form selection field selectedIndex not working properly" to "[4.xP]HTMLSelectElement.options.selectedIndex not supported". Since options is an HTMLCollection, this might require some work.
Assignee: vidur → pollmann
Grabbing this one.
Status: NEW → ASSIGNED
OS: Windows NT → All
Hardware: Other → All
Target Milestone: M11
Moving non-critical bugs out.
Target Milestone: M12 → M14
Moving to M14 see bug 16879 for reasons why.
*** Bug 23087 has been marked as a duplicate of this bug. ***
Setting seviarity to major.
Severity: normal → major
Setting the keyword all open [4.xp] bugs to 4xp.
Keywords: 4xp
Keywords: beta1
Putting on PDT+ radar for beta1.
Whiteboard: [PDT+]
Summary: [4.xP]HTMLSelectElement.options.selectedIndex not supported → HTMLSelectElement.options.selectedIndex not supported
Whiteboard: [PDT+] → [PDT+] 11-Feb-2000
I brought the changes forward into my tree and they almost work (one bug I'm working on in setLength for bug 16879). Will update status later today. (Performance is better, but not great.)
Whiteboard: [PDT+] 11-Feb-2000 → [PDT+] 15-Feb-2000
Fix for this bug and bug 16879 is ready. I touched the following files (!=new) Will need a code review (I'll hit Vidur up for one) and approval. dom/public/idl/html/ ! nsHTMLOptionCollection.idl nsHTMLSelectElement.idl makefile.win Makefile.in dom/public/html/ nsIDOMHTMLSelectElement.h ! nsIDOMNSHTMLOptionCollection.h makefile.win Makefile.in MANIFEST dom/src/html/ nsJSHTMLSelectElement.cpp ! nsJSNSHTMLOptionCollection.cpp Makefile.in makefile.win (add to dom/macbuild/dom.mcp) layout/html/content/src/ Makefile.in makefile.win ! nsHTMLOptionCollection.cpp ! nsHTMLOptionCollection.h nsHTMLOptionElement.cpp nsHTMLSelectElement.cpp ! nsHTMLSelectElement.h (add to layout/macbuild/layout.mcp) layout/html/forms/src/ nsListControlFrame.cpp extensions/wallet/src/ wallet.cpp
Whiteboard: [PDT+] 15-Feb-2000 → [PDT+] Fix in hand, need code review / approval
Got a review from Vidur for this yesterday.
Whiteboard: [PDT+] Fix in hand, need code review / approval → [PDT+] Fix in hand, need approval
Whiteboard: [PDT+] Fix in hand, need approval → [PDT+] approved/reviewed fix in hand (will check in after bug 28691)
Just checked in the fix. This also fixed bug 16879.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
verified with 02-29-09.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.