Javascript: Backspace in a textbox
Moderator: General Moderators
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
Javascript: Backspace in a textbox
What is the code to backspace in a textbox on a click of a button. Like in the textbox it says "hellos" and you click the button on the screen and it backspaces to "hello". Really it would be numbers since this is for a calculator but you get my drift.
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
That is what you are asking. You need the character code for backspace. Do as he suggested, and google your answer.tecktalkcm0391 wrote:Thats not what I am asking.
The second result has backspace as the first listed code.
Take that, and some onchange/onsubmit javascript, acting on the textbox id. Done.
Last edited by Roja on Tue Jun 13, 2006 2:54 pm, edited 2 times in total.
Oh, my mistake.
What have you tried? You've been around these boards to know you don't get code without at least putting in some effort
You'd want to get the value, then get a substring of that value of length - 1.
What have you tried? You've been around these boards to know you don't get code without at least putting in some effort
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
You are not even trying.tecktalkcm0391 wrote:What I did was searched google for like 30 mintues trying to find how to do it and all I got was the character code and its 8, nowIs what i don't know how to do.You'd want to get the value, then get a substring of that value of length - 1.
The function in javascript is even *CALLED* substring.
http://www.novell.com/documentation/ext ... ngsJS.html
First google result for "javascript substring".
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida