Closed
Bug 247026
Opened 20 years ago
Closed 20 years ago
Function submit() is undefined in forms. Calling submit() doesn't post the form.
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 247745
People
(Reporter: bugzilla.mozilla, Unassigned)
Details
Attachments
(1 file)
281 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040614 Firefox/0.9 When calling submit() in a form the form is not submitted. This warning shows in the JavaScript console: "submit is undefined". Also this.submit() doesn't work: "this.submit is not a function". It does work in older versions of Firefox (and Mozilla). Example code: <form action="/" method="post"> <table> <tr> <td onClick="submit();">Click here</td> </tr> </table> </form> Reproducible: Always Steps to Reproduce: 1. Open a page containing the example code 2. Click on 'click here' 3. Actual Results: Form is not submitted Expected Results: Form should be submitted Tested on two computers, both with Win 2000. Many sites use the submit() function, so this should really be fixed soon.
Comment 1•20 years ago
|
||
I would think this is INVALID, but this indeed worked in Mozilla1.6 (for some kind of IE compatibility reason?). This doesn't work in Opera7.23 by the way, so you could better use the dom: document.forms[0].submit() or something like that.
Reporter | ||
Comment 2•20 years ago
|
||
> so you could better use the dom:
> document.forms[0].submit() or something like that.
Sometimes, when you have more than one form on a dynamically generated page, you
don't know in what form you are (forms[0],[1],[2] or whatever). Of course you
can build a script to print the right forms[n], but not every webmaster will do
that.
Updated•20 years ago
|
Component: General → DOM
OS: Windows 2000 → All
Product: Firefox → Browser
Version: unspecified → Trunk
Updated•20 years ago
|
Assignee: firefox → general
QA Contact: firefox.general → ian
Reporter | ||
Comment 3•20 years ago
|
||
(In reply to comment #1) > This doesn't work in Opera7.23 by the way, so you could better use the dom: > document.forms[0].submit() or something like that. It does work in Opera 7.51 Final (for Linux). I don't know if 'submit()' is 100% valid JavaScript, but I think 'this.submit()' is. Does that work in Opera 7.23?
Comment 4•20 years ago
|
||
*** This bug has been marked as a duplicate of 247745 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•