Archive for the ‘Forms’ Category

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…)

Javascript form validation

Monday, December 14th, 2009

Quite an old one this, but I don’t want to lose momentum so i’m posting it for want of anything else. This is a good old fashioned form validation script. It’s faily customisable and uses alerts to indicate missing information. It also focuses on and highlights the relevant field. The zip file contains the javascript and a sample HTML form so you can see it in place. Enjoy.