Closed
Bug 11703
Opened 26 years ago
Closed 25 years ago
{formname}.submit does not work
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
VERIFIED
WORKSFORME
People
(Reporter: kmcclusk, Assigned: vidur)
References
()
Details
(Whiteboard: [TESTCASE] can't access forms via {formname} in onClick handler)
Attachments
(1 file)
(deleted),
text/html
|
Details |
Go to the url above and click on the Search By: radio buttons. Clicking on the
radio button performs a formname.submit() in a onclick mouse handler for the
radio button. a JavaScript error: FormSearch is not defined is output.
The following test case has two buttons. The first button causes the page to
change by first using getElementById then invoking submit. The second button
uses the name of the form to invoke the submit. The first button works, the
second one doesn't. There doesn't seem to be any problem with the buttons. The
problem seems to be that JavaScript can not find the form element when you refer
to it by it's name attribute.
<html>
<head>
<script>
function changepage()
{
var el = document.getElementById("formid");
el.submit();
}
</script>
</head>
<body>
<form METHOD="GET" ACTION="http://search.yahoo.com/bin/search" id=formid
NAME="searchform">
<input type=button value="use searchform.submit" onclick="searchform.submit();">
<input type=button value="use getElementById" onclick="changepage();">
</form>
</body>
</html>
Comment 1•26 years ago
|
||
Updated•26 years ago
|
Whiteboard: [TESTCASE] can't access forms via {formname} in onClick handler
Comment 2•26 years ago
|
||
Vidur,
In the testcase the code onclick="searchform.submit();" doesn't work. (This is
how the microsoft page above codes it)
HOWEVER, changing it to onclick="document.searchform.submit();" works!
What is the scope chain supposed to look like inside an onClick handler in a
form? (Win98 19990816 nightly build)
Comment 3•26 years ago
|
||
And, BTW, the original submitter had it switched around. The first button
doesn't work, the second button works.
This must have been fixed some where along the way, because it works fine with
the latest build
Comment 8•24 years ago
|
||
Verifying on
-Windows98 build 2000-09-26-08-M18
-Linux RedHat6.2 build 2000-09-27-08-M18
Status: RESOLVED → VERIFIED
Comment 9•7 years ago
|
||
regression in 57.0 returns undefined and doesn't always work.
Updated•6 years ago
|
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•