Click to See Complete Forum and Search --> : How to read key Backspace
jxiong
Jul 10th, 2001, 09:48 AM
Is there a way to disable the Backspace? I am a simple
html and asp script, but there are fields that I would like to
disable. I looked at the Onkeypress but still did not give
me and/or work with the Backspace at all.
Thanks in advance for any help.
sebs
Jul 10th, 2001, 09:50 AM
what exactly do you mean by disable field!!
jxiong
Jul 10th, 2001, 09:55 AM
What I am trying to say is that I do not want to the users to
edit a particular field on my html form. I was able to use the
following code to not allow the user to key in anything, except
for the Backspace key, ie. he could hilite the text and then
press the Backspace to wipe out the text in the text box.
Hope this helps.
HERE is the code:
onKeypress="if (event.keyCode > 0) event.returnValue = false;"
sebs
Jul 10th, 2001, 09:56 AM
put your text field to readonly:
<input type="text" name="someName" readonly>
this will do
jxiong
Jul 10th, 2001, 09:58 AM
That is all I need. Appreciate your quick help.
Have a great day!
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.