Closed Bug 148248 Opened 22 years ago Closed 22 years ago

image named 'submit' inside of form shadows the method form.submit()

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED INVALID
mozilla1.0.1

People

(Reporter: bc, Assigned: jst)

References

()

Details

(Whiteboard: [HAVE FIX])

Attachments

(3 files, 2 obsolete files)

The url contains a page with a form named |investForm| which contains a link
around an image that is named |submit|. 

document.investForm.submit points to the image and not the submit function for
the form. This does not agree with Nav4.
For backwards compatibility reasons with 4x we can't not expose images by their
name on form objects, but we can special case form.submit to never be shadowed
by any form controls or images on a page. Morphing bug...
Status: NEW → ASSIGNED
OS: Windows 2000 → All
Hardware: PC → All
Summary: image with name inside of form becomes property of form object → image named 'submit' inside of form shadows the method form.submit()
Target Milestone: --- → mozilla1.0.1
Attachment #85676 - Attachment is obsolete: true
Whiteboard: [HAVE FIX]
Attachment #85818 - Attachment is obsolete: true
Comment on attachment 85821 [details] [diff] [review]
Same for form.reset()...

sr=vidur
Attachment #85821 - Flags: superreview+
Attached file Testcase
This testcase shows which "submit" is used.  In IE 6, the input is used, not
the method.  And that seems right to me.
Attachment #85826 - Attachment is patch: false
Attachment #85826 - Attachment mime type: text/plain → text/html
Ok. I must have been on crack. jkeiser is right. nav4, IE6 and Mozilla agree
that an input named submit or even a simple image named image in the form is
exposed the same way as document.formname.submit. -> invalid
but why does IE6 submit the form on the ingdirect site?
In IE, you have this weird thing where form.submit can be an image or input 
while form.submit() calls the form's submit method.  This behavior is a 
violation of the ECMA spec.
ok. god i hate IE. sorry for all the extra work. ->invalid.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
I *believe* we could make mozilla work that way too, at least for form controls,
but for images it would be hard (since we don't know what form they belong to).
I can't say I want to do that tho, but if we really have to...
*** Bug 160692 has been marked as a duplicate of this bug. ***
*** Bug 160692 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: