PDA

View Full Version : Textarea Limiter



icesolid
03-23-2006, 04:27 PM
I am playing around with one of the scripts on dynamicdrive.com, it is the one that limits a textarea and outputs how many characters are left. The script is located here (http://www.dynamicdrive.com/dynamicindex16/limitinput.htm). Using the script provided on that page if I was to already have characters in the textarea like this:


<form name="sampleform" action="post" method="test.html">
<textarea id="field1" name="field1" cols="50" rows="15">Text Here</textarea><br>
<font face="Verdana" size="1">Max 50; characters remaining: <script>displaylimit("document.sampleform.field1", "", "50");</script>

The display of how many characters does not show that there are 9 characters gone, it still shows that there are 50 available until the user enters a character, then it displays how many are really left.

I was wondering how could I have this script tell me how many characters are in the textarea at all times?

Twey
03-23-2006, 04:45 PM
This script is very dodgy indeed. I wouldn't bother with it, if I were you.