Forum Moderators: open

Message Too Old, No Replies

Removing <TextArea> Scroll Bars?

         

tesla

9:11 pm on Sep 18, 2002 (gmt 0)

10+ Year Member



How can I limit the number of characters allowed to be entered into a text box, or how can I remove the scroll bars to hopefully acheive the same results?
I don't want to accept more than 255 characters.

Thanks,

moonbiter

10:34 pm on Sep 18, 2002 (gmt 0)

10+ Year Member



You cannot limit the number of characters in a textarea element [cs.tut.fi]. If you need to limit the imput, you need to use scripting to cut it off (and perhaps warn the user you are going to do this).

If you want to get rid of the scrollbars, use the style overflow: hidden. This will not prevent a user from entering as many characters as he wants, however.

joshie76

2:32 pm on Sep 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There's a rather neat behaviour for IE on siteexperts [siteexperts.com] that allows you to use a maxlength attribute that works just like a maxlength on a normal field.

Handy if you're working on an IE only project.