...

View Full Version : Deleting the first right letter in a textbox



StealthRT
12-16-2007, 02:59 AM
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:


onclick="document.frmFB.txtFName.value=document.frmFB.txtFName.value + '@';"

And this is what i've tryed to get it to delete the last letter:


onclick="txtFName.Select(txtFName.SelectionStart - 1, 1)"

Any help would be great! :)
David

Kor
12-16-2007, 06:08 AM
RegExp (http://lawrence.ecorp.net/inet/samples/regexp-intro.php) is your friend:


onclick="txtFName.value=txtFName.value.replace(/.$/,'')"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum