counting characters in textbox

lanche26

Solid State Member
Messages
17
hello

i have a text box and it has a text "1000"

and i also have a textbox 2 and i want the 1000 to be deminished whenever i typed in textbox 2 so that i can see how many characters i have typed in textbox 2


please help me!
 

berry120

Fully Optimized
Messages
3,434
Location
UK
Obviously as above this hugely depends on the language, but you can usually get the text in the textbox as a string and subsequently find out the length of the text.

So in Java for instance it'd be something like:

Code:
int remaining = 1000-textBox.getText().length();
countTextBox.setText(Integer.toString(remaining));

Translate to language of your choice!
 
Top