Closed Bug 3285 Opened 26 years ago Closed 25 years ago

[4.xP] indexing into form element to get children

Categories

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

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: morse, Assigned: pollmann)

References

()

Details

Attachments

(2 files)

The following content gives the correct value for the alert when run under the 4.5 browser but it gives "undefined" in 5.0. This bug is currently blocking some of the wallet work. <HTML> <HEAD> <SCRIPT> title_frame = 0; list_frame = 1; function load(){ top.frames[list_frame].document.open(); top.frames[list_frame].document.write( "<FORM name=fSelectFillin>" + "<TABLE>" + "<TR>" + "<TD>" + "<SELECT>" + "<OPTION VALUE=\"X\"> Y </OPTION>" + "</SELECT><BR>" + "</TD>" + "</TR>" + "</TABLE>" + "</FORM>" ); alert(top.frames[list_frame].document.fSelectFillin[0]); }; </SCRIPT> </HEAD> <FRAMESET ROWS = 25,* onLoad=load()> <FRAME SRC=about:blank NAME=title_frame SCROLLING=NO MARGINWIDTH=1 MARGINHEIGHT=1 NORESIZE> <FRAME SRC=about:blank NAME=list_frame SCROLLING=AUTO MARGINWIDTH=0 MARGINHEIGHT=0 NORESIZE> </FRAMESET> <NOFRAMES> <BODY> <P> </BODY> </NOFRAMES> </HTML>
My cvs checkout keeps hanging. Will have to get help building.
See bug report 3340 which might be related to this one.
Assignee: norris → vidur
This is almost certainly in the DOM, not JavaScript.
Assignee: vidur → pollmann
Eric Pollmann is the right guy for DOM forms related bugs. Eric, Steve Morse is blocked by this bug.
I'm confused as to what this javascript is supposed to do. I'll assume that "top.frames[list_frame].document.fSelectFillin[0]" is supposed to return the first element in the form fSelectFillin, the select element. Again, according to the DOM spec, you can not index directly into a form element to access it's children. If, for example, you want to access the select element you should try this: top.frames[list_frame].document.fSelectFillin.elements[0] This works for both 4.5 and 5.0 - is this an acceptable solution for this problem?
Status: NEW → ASSIGNED
It's an acceptable work-around forme and I am no longer blocked on this one. But it is not an acceptable solution. Since this was valid in 4.5, there may be content out on the web that is using it and they will suddenly break when we roll out 5.0.
Severity: major → normal
Summary: javascript gives wrong answer for values in a form → compatibility: indexing into form element to get children
I agree. At a minimum, we should accept this syntax when in compatibility mode. Marking this a compatibilty bug.
per leger, assigning QA contacts to all open bugs without QA contacts according to list at http://bugzilla.mozilla.org/describecomponents.cgi?product=Browser
DOM bugs are not my problem.
QA Contact: 4015 → 4616
QA contact re-assigned according to the product areas we're currently working on.
Target Milestone: M7
Component: JavaScript → DOM Level 0
Moving to DOM Level 0 component. Move to DOM Level 1 if that is more correct.
Redistributing bugs...
Summary: compatibility: indexing into form element to get children → [4.xP] indexing into form element to get children
Attached file reduced test case (deleted) —
I've got a fix, waiting for the tree to reopen.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
OS: Windows NT → All
Hardware: PC → All
Resolution: --- → FIXED
Just checked in a fix.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Eric, Reopening this bug. Its still returning undefined. Tested with todays builds.
Attached file Original test case. (deleted) —
Status: REOPENED → RESOLVED
Closed: 26 years ago25 years ago
Resolution: --- → FIXED
Hm, my fix works for me... I just attached the original test case. You should see "[object HTMLSelectElement]" dumped to the console when this page is loaded. Also check out the "reduced test case", which should have a text element reading "Bar" - also works for me. If you are still unable to reproduce the this, can you please me detailed info on what you are seeing? Thanks!
Status: RESOLVED → VERIFIED
I can see "[object HTMLSelectElement]" dumped to the console. Marking verified.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: