![]() |
| ||
| simple Javascript counting function Hi, i have a form on my website, and I would like to have a text box next to another text box that displays how many letters the user can type into the box eg: <td><input type="text" name="description" maxlength="30" /></td> This is fine, but I would like the box with the numbers in it to count down as the user types in the first box, and if they delete something i would like the number to go back up again too. If anyone could help me that'd be great thanks. |
| ||
| Re: simple Javascript counting function use onkeydown event in text box, in this event write a function which will take value of textbox check the length of string and then print the no. in the box...... |
| ||
| Re: simple Javascript counting function Hi There, Try This Code javascript: <script type="text/javascript"> HTML: <input type="text" name="description" maxlength="30" id="description" onkeyup="valueChange()" /></td> Rahul Dev Katarey |
| ||
| Re: simple Javascript counting function thanks katarey, that was exactly what I was looking for |
| All times are GMT -4. The time now is 3:39 pm. |
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC