Results 1 to 5 of 5

Thread: How to read key Backspace

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2000
    Posts
    303

    How to read key Backspace

    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.

  2. #2
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    what exactly do you mean by disable field!!

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2000
    Posts
    303
    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;"

  4. #4
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    put your text field to readonly:

    <input type="text" name="someName" readonly>

    this will do

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2000
    Posts
    303

    Thanks, Sebs

    That is all I need. Appreciate your quick help.

    Have a great day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width