Bug 16374 - onclick event is not fired for input=button
Summary: onclick event is not fired for input=button
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.5
: P2 Major
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-09 19:58 PST by Pat Neill
Modified: 2007-12-09 21:25 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pat Neill 2007-12-09 19:58:21 PST
When the button is highlighted, IE 6 and FireFox 2.0.0.11 (Windows 
and Mac) both fire the onclick event when the Enter/Return key is 
pressed.  Safari 3 (neither Windows or Mac) doesn't. 

I have a simple page 
<html> 
<head> 
        <script type="text/javascript"> 
                function say_hi() 
                { 
                        alert('Hi.'); 
                } 
        </script> 
</head> 
<body> 
        <input type="button" value="Say Hi" onclick="say_hi();"> 
</body> 
</html> 

When the button is highlighted, IE 6 and FireFox 2.0.0.11 (Windows   
and Mac) both fire the onclick event when the Enter/Return key is   
pressed.  Safari 3 (neither Windows or Mac) doesn't.  Is there some   
special way of getting that to work in Safari without resorting to   
trapping the key in an onkeypress event?
Comment 1 Adam Roben (:aroben) 2007-12-09 21:25:43 PST
This was fixed in r27652 <http://trac.webkit.org/projects/webkit/changeset/27652>.