Posts Tagged ‘word count’

Javascript forms – textarea word count

Monday, April 5th, 2010

Happy Easter loyal readers (or possibly reader). Here’s a nice simple piece of JavaScript that counts down the number of words remaining in a restricted text field as you type. When you hit your limit and the counter hits zero you will no longer be able to type any words untill you delete some. There is no restriction here on characters and words are defined by spaces only. The example below shows it in action.

Textfield is limited to 50 words.

words remaining: 50

File’s attached as usual here – so download them, use them and together we can make HTML forms fun! (as long as you don’t have JavaScript disabled…)