Displaying the Number of Words Typed Into an HTML Form
While programming Master Reciprocal
Links Pro (which should be ready for release soon), I needed to limit and
display the number of words in a link request form field.
I did a quick search on the Internet to see how others might have done it
and found only examples of how to limit and display the number of characters.
I needed to do it with words.
So I made one without the time saving benefit of example.
This article and accompanying demonstration at URL
http://willmaster.com/a/24h/pl.pl?art245 show you how
do to it, too. Copy and paste and specify your preferences.
And it can display the number already typed, the number still available,
has eight places where you can specify your preferences.
into your custom form.
But then your form handling CGI program should catch the attempt.
There are several reasons I wanted to display the number of words and monitor
words/characters have been typed and how many are still allowed.
This is much better than saying, "Describe your site with 50 words or less"
and then leaving it up to the user to do the counting.
Although Master Reciprocal Links Pro will catch attempts to bypass the site
description word count limitations the webmaster has specified, it is easier
to submit the form and only then receive CGI program error messages.
submitting the form and the program sending an error page back which, depending
on user connection speed and domain server speed, might be several long seconds.
When you need to limit the amount of text a user may type into a form and
display the count for the user,
http://willmaster.com/a/24h/pl.pl?art245 is where to find
a working example.
Copyright 2004 Bontrager Connection, LLC
About the Author: