Jump to content

[SOLVED] backspace aka. substring function


haolan

Recommended Posts

Hi phpfreaks..

 

I am trying to create a function to remove one number from a textbox, just like a backspace button.

I have made the following code:

 

function backspace() {

display = document.post_form.post_display.value;

disp_length = display.length;

 

newString = display.substring(0, disp_length - 1);

document.post_form.post_display.value = newString.ToString();

}

 

My form is named post_form and the textbox is named post_display.

 

This code does not work.. What is wrong?

Link to comment
https://forums.phpfreaks.com/topic/63906-solved-backspace-aka-substring-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.