How To Prevent Form Submission When User Presses the ENTER Key on a Form (298498)
The information in this article applies to:
- Microsoft Internet Explorer (Programming) 4.0
- Microsoft Internet Explorer (Programming) 4.01
- Microsoft Internet Explorer (Programming) 4.01 SP1
- Microsoft Internet Explorer (Programming) 4.01 SP2
- Microsoft Internet Explorer (Programming) 5
- Microsoft Internet Explorer (Programming) 5.01
- Microsoft Internet Explorer (Programming) 5.01 SP1
- Microsoft Internet Explorer (Programming) 5.5
This article was previously published under Q298498 SUMMARY
When the focus is on an HTML form, and the user presses the ENTER key, by default, Internet Explorer treats this action as if the user clicks Submit. However, not all browsers behave the same way, and you may want to disable this behavior. This article demonstrates how to use script to prevent this behavior.
REFERENCES
For more information about the onkeydown event, see the following Microsoft Web site:
For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:
Modification Type: | Major | Last Reviewed: | 5/11/2006 |
---|
Keywords: | kbDHTML kbhowto kbScript KB298498 |
---|
|