Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder StealthRT's Avatar
    Join Date
    Aug 2006
    Posts
    187
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Question Deleting the first right letter in a textbox

    Hey all im trying to just delete the last letter on the right side of a textbox. I am trying to do this via onclick for a backspace button. Does anything have code for this or know what i can search for because i come up with nothing everything i try.

    This is what i us to add to the textbox:
    Code:
    onclick="document.frmFB.txtFName.value=document.frmFB.txtFName.value + '@';"
    And this is what i've tryed to get it to delete the last letter:
    Code:
    onclick="txtFName.Select(txtFName.SelectionStart - 1, 1)"
    Any help would be great!
    David

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    RegExp is your friend:
    Code:
    onclick="txtFName.value=txtFName.value.replace(/.$/,'')"
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

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