Closed
Bug 279956
Opened 20 years ago
Closed 20 years ago
onclick handler invoked using .click() when it should not !
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
EXPIRED
People
(Reporter: lukin1, Assigned: bugzilla)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
.click() is invoking the "onClick" handler when it shouldn't (according to
http://docs.sun.com/source/816-6408-10/submit.htm#1193782)
Reproducible: Always
Steps to Reproduce:
1. Open the HTML below & click on the "Do it" button
2. Cycle thru the alert's & see that the onclick handler is getting called &
invoking the doit() method a second time!
<html>
<head>
<SCRIPT language="JavaScript">
var num=0;
function doit(form2submit, btnName, btnValue){
alert("DOIT CALLED: " + (++num) + " time(s)");
var form = eval('document.' + form2submit);
var btn = form.elements[btnName];
for (i=0; i<btn.length; i++){
//alert('[' + btn[i].value + '] - [' + btnValue + ']');
if (btn[i].value == btnValue) {
//by definition calling .click() will not invoke the onClick handler
//http://docs.sun.com/source/816-6408-10/submit.htm#1193782
//but it seems to in FireFox 1.0 !
alert("CALLING CLICK!");
btn[i].click();
return true;
}
}
return false;
}
</script>
</head>
<body>
<FORM name="formname" action="http://bugzilla.mozilla.org">
<INPUT type="submit" onclick="return doit('formname', 'check', 'Do it')"
name="check" value="Do it" >
<INPUT type="submit" onclick="return doit('formname', 'check', 'Do it 2')"
name="check" value="Do it 2" >
</FORM>
</body>
</html>
Actual Results:
handler is invoked by the .click() function call
Expected Results:
onclick hander should not be called, and button should act as if it was clicked
Comment 1•20 years ago
|
||
This is an automated message, with ID "auto-resolve01".
This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.
While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.
If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.
The latest beta releases can be obtained from:
Firefox: http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey: http://www.mozilla.org/projects/seamonkey/
Comment 2•20 years ago
|
||
This bug has been automatically resolved after a period of inactivity (see above
comment). If anyone thinks this is incorrect, they should feel free to reopen it.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → EXPIRED
You need to log in
before you can comment on or make changes to this bug.
Description
•