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

RESOLVED DUPLICATE of bug 242557

Status

()

RESOLVED DUPLICATE of bug 242557
15 years ago
5 years ago

People

(Reporter: korbs, Assigned: bugzilla)

Tracking

({regression})

Trunk
x86
Windows XP
regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

15 years ago
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

Comment 1

15 years ago
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)

Comment 2

15 years ago
<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
Last Resolved: 15 years ago
Resolution: --- → INVALID

Comment 3

15 years ago
*** Bug 216747 has been marked as a duplicate of this bug. ***

Comment 4

15 years ago
*** Bug 247026 has been marked as a duplicate of this bug. ***

Comment 5

15 years ago
*** Bug 250353 has been marked as a duplicate of this bug. ***

Comment 6

15 years ago
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

Comment 8

15 years ago
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
Last Resolved: 15 years ago15 years ago
Resolution: --- → DUPLICATE

Updated

14 years ago
Flags: blocking-aviary1.0?

Updated

5 years ago
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.