[thelist] textarea limitations

Bill Lovett blovett1 at rcn.com
Sun Sep 30 19:36:14 CDT 2001


On Mon, Oct 01, 2001 at 10:07:18AM +1000, Adrian Fischer wrote:

> I have this textarea which has a js function that stops them from entering
> to many characters and it works just fine. The problem happens when users
> keep hitting the Enter key.  Even though they haven't use all the characters
> the input scrolls of the screen when next displayed (it goes into a db with
> <br> for new lines)

You're looking for something like an input tag's maxlength attribute?
I found this article which addresses that subject (although it seems
to be MS-centric):

http://www.siteexperts.com/ie5/htc/ts08/page1.asp

> Is there a way I can physically limit the umber of lines.  I'm think ..NO.
> What about checking server side for \n or \r and limiting the number of
> those.

Why not do that client side? Before the form submits, use the regular
expression object to weed out multiple newlines before they ever make
it to the server.

-bill




More information about the thelist mailing list