Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trapping Key Strokes 1

Status
Not open for further replies.

simonWMC

Programmer
Dec 2, 2002
180
GB
Hello again...

I am looking to track the keystokes of the user as they answer text into a text box in a form. I want to know how many characters they have typed, therfore counting keypresses but minus by one for presses of the backspace key, and delete key.

can i do this with javascript ?

thankyou - i am very grateful for your help

Simon
 
Thankyou cheech ! That is great ! Hopfully i can make it work with coursebuilder !

thanks again !!!
 
You shouldnt have any probs

Cheech

[Peace][Pipe]
 
can't work out how to apply to my coursebuilder created text box, and get it to send the number of characters typed to my tracking page
 
You need to call the function from your textbox, so add the stuff to the head of your document then add

onKeyDown="textCounter(this.form.message,this.form.remLen,125);" onKeyUp="textCounter(this.form.message,this.form.remLen,125);"

to the <textarea> tag and all else should be the same

Cheech

[Peace][Pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top