Discussion Locked

Limiting Text in a Textarea

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I've been trying to limit the amount of text that can be actually and visibly written into a textarea text box. Much like the ones on Lycos free SMS and Vizzavi.co.uk free SMS etc (without the countdown box)... I've got as far as the following code but I get an alert box each time I type a character in the text box, which lets me know I have typed a character.

Can anyone point out where I have gone wrong, if it is possible to remove the number indicator alert, and how to do it.

Muchas Gracias

MP

7 replies

by kanto boy

Hmm . . . ok form the looks of your code its compatible with MS IE only. So I guess this might help you. Set the maxlength attribute of textarea to the number of characters you want. This has the advantage of working even if javascript is turned off.

ex.

Difference would be that the user wouldnt get the message box everytime he pressed a key.

This discussion is closed to new replies.