Entry
How can I prevent the ESC key from resetting a complet FORM in IE?
Jun 10th, 2000 08:32
Martin Honnen,
IE seems to have the habit of resetting the complete form when you
press ESC inside a form element. The following code prevents that
<HTML>
<HEAD>
<STYLE>
</STYLE>
<SCRIPT>
if (document.all)
document.onkeydown = function () {
return event.keyCode != 27;
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="formName">
<INPUT TYPE="text" NAME"field1">
<BR>
<INPUT TYPE="text" NAME"field2">
<BR>
<INPUT TYPE="text" NAME"field3">
<BR>
<INPUT TYPE="text" NAME"field4">
<BR>
<INPUT TYPE="submit">
<INPUT TYPE="reset">
</FORM>
</BODY>
</HTML>