Closed Bug 247745 Opened 20 years ago Closed 20 years ago

submit of form failed when using submit() in onclick event

Categories

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

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 242557

People

(Reporter: korbs, Assigned: bugzilla)

References

Details

(Keywords: regression)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a2) Gecko/20040619 Firefox/0.8.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a2) Gecko/20040619 Firefox/0.8.0+

submitting a form seems to fail in html files where an onclick javascript event
is used with the submit() handler

eg: the code <a href="#" onClick="submit()">

when the link is clicked JavaScript Console reports "Error: Submit Is Not Defined"
problem didnt used to occur in builds of 0.7 i'd tested

Reproducible: Always
Steps to Reproduce:
1. 
2.
3.

Actual Results:  
Form did not submit, page did not refresh (just acted like a normal # href)

Expected Results:  
submitted form
i'm pretty sure (although not positive) that you need to tell it which form to
submit.

for example:
- you have a form named loginForm
- to submit this form you would do loginForm.submit() for the onclick event
- or if you were in the form you could do this.submit() (i think)
<a href="#" onClick="submit()">

is completely invalid, try
<a href="#" onclick="document.forms['forname'].submit()">

--> INVALID

Please reopen if you can reproduce this with a nightly build and a minimized
testcase showing the bug
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
*** Bug 216747 has been marked as a duplicate of this bug. ***
*** Bug 247026 has been marked as a duplicate of this bug. ***
*** Bug 250353 has been marked as a duplicate of this bug. ***
From one of the dups: This is a regression since Mozilla 1.6.
Status: RESOLVED → UNCONFIRMED
Component: General → DOM
Flags: blocking-aviary1.0?
Keywords: regression
Product: Firefox → Browser
Resolution: INVALID → ---
Version: unspecified → Trunk
This is a duplicate of the "scope chain for nodes inside forms no longer
includes the form" bug.  Please find the original and mark this duplicate.
Whiteboard: DUPEME
I tried to find it but couldn't.  Do you know anything else about it, like who
owns it or what component it is in?
jst owns it, I would think, and it should be in DOM0.

It's fallout from bug 147058.

I'm not quite sure what good search terms would be, though....
Actually, bug 242557 is what I was thinking of.

*** This bug has been marked as a duplicate of 242557 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → DUPLICATE
Flags: blocking-aviary1.0?
Whiteboard: DUPEME
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.