SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
Hybrid View
-
Nov 19, 2002, 16:13 #1
how to count number of chars while writing in textarea ?
Hi
i need to count the number of chars while the user is typing in the textarea or input, coz there are limit abd i wanna show him how many char he haa typed, and how many he can type !
is there any way to do this with Js. ?
thx alot !
-
Nov 19, 2002, 16:45 #2
- Join Date
- Oct 2002
- Location
- Delft, The Netherlands
- Posts
- 46
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Here's a snippet of example code:
Code:<form name="myform"> <input type="text" name="mytext" size="20" maxlength="15" onkeyup="this.form.charsleft.value = (this.maxLength - this.value.length)"> <br> You can type <input type="text" name="charsleft" value="15" size="3"> more chars </form>
"A poor programmer is he who blames his tools."
http://analyser.oli.tudelft.nl/
-
Nov 20, 2002, 02:13 #3
thx ..
but how to get how many char is wroted while is writing ?
-
Nov 20, 2002, 04:20 #4
- Join Date
- Mar 2002
- Location
- Svíþjóð
- Posts
- 4,080
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Another example:
http://www.sitepointforums.com/showt...264#post572071
-
Nov 20, 2002, 05:26 #5
kosz haver
a szemem elott volt es nem lattam this.value.length
-
Nov 20, 2002, 05:46 #6
- Join Date
- Mar 2002
- Location
- Svíþjóð
- Posts
- 4,080
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Szívesen
Bookmarks