|
 |
asp_components thread: help in getting "esc" key to be ignored in web pages
Message #1 by "Scott Hill" <scotthill@l...> on Wed, 10 Apr 2002 20:31:14
|
|
I have been attempting to create or find code that I can insert into
various interactive web pages that will ignore the esc key if pressed. I
have pages that customers inout data into to be pushed in database tables,
if they hit the esc key it erases all data entered and is very frustrating
you can understand. If someone knows or an way or has already written code
that ignores the esc key I would appreciate help or a copy of the code.
TIA -
Scott Hill
scotthill@l...
Message #2 by JKelly@w... on Wed, 10 Apr 2002 15:50:32 -0400
|
|
Scott:
I presume we are talking about HTML Forms here.
A quick fix would be to add the onkeydown event to each element on the form
you do not want to respond to and escape key and write some code similar to
the following:
<INPUT type="text" id=text1 name=text1 onkeydown="
if (event.keyCode==27)
{
event.cancelBubble = true;
event.returnValue=false;
}
">
KeyCode 27 is the Escape Key
This works for IE 5.5 Not sure about other IE versions
Good Luck,
Jim A. Kelly
Web Developer
Email: JKelly@W...
"Scott Hill"
<scotthill@l... To: "ASP components" <asp_components@p...>
ent.com> cc:
Subject: [asp_components] help in getting "esc" key to be ignored in web pages
04/10/02 04:31
PM
Please respond
to "ASP
components"
I have been attempting to create or find code that I can insert into
various interactive web pages that will ignore the esc key if pressed. I
have pages that customers inout data into to be pushed in database tables,
if they hit the esc key it erases all data entered and is very frustrating
you can understand. If someone knows or an way or has already written code
that ignores the esc key I would appreciate help or a copy of the code.
TIA -
Scott Hill
scotthill@l...
%%email.unsub%%
|
|
 |