Connecting Tech Pros Worldwide Help | Site Map

esc key clears html input text values

Newbie
 
Join Date: Oct 2008
Posts: 10
#1: Oct 1 '09
Hi,
I have created 2 html input text boxes with readonly property set to 'readonly'. I am handling the esc key event(27) in javascript code. When I press the esc key for the first time it will not harm any thing. But if i press the esc key 2nd time it will clear both the input text box values. Please let me know is this the correct behavior? What should I do to retain the text values?

Thanks,
Nags
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#2: Oct 1 '09

re: esc key clears html input text values


Quote:

Originally Posted by coolnags View Post

I am handling the esc key event(27) in javascript code.

and how do you do that?
Newbie
 
Join Date: Oct 2008
Posts: 10
#3: Oct 5 '09

re: esc key clears html input text values


I have attached the hadnler using AddHandler api for keydown of the text box whose text is getting cleared. I am using IE6.
Reply

Tags
esc key html javascript