[thelist] Limiting length of textarea field

FayeC ftarzwell at fayec.com
Thu Jan 4 14:54:03 CST 2007

I was given a request to limit the textarea's length to the size of
the visible area of a textarea. This is to allow the printed copy to
have the same content as the form sent by email.
So I found a javascript that limits the number of characters of a textarea.
It works fine but since it doesn't consider a line break a character
people can still enter lines and lines of text beyond the visible area
of the textarea as long as there are still characters to be used.

I have a 7 row, 68 column textarea and I limited the characters to
475. It works fine if you type a straight line of 475 characters but
if you break the line after a few words on each line you can go way
beyond the visible area which means that even though the email will be
sent with the correct content, the printed copy won't.
Doesn't anybody know a way to limit the content to the amopunt of lines as well?



More information about the thelist mailing list