Limit to 150 characters in multi-line textbox

M

Mark

Can you limit the number of characters in a multi-line textbox? My tests in
indicate that the MaxLength property causes client side limits only on
single line textboxes.

Thanks in advance!

Mark
 
M

Marina

If this doesn't work on multiline textboxes, you will have to write
javascript to handle the onkeydown event or something like that, to prevent
the user from entering more then 150 characters.
 
M

Michal A. Valasek

| Can you limit the number of characters in a multi-line textbox? My tests
in
| indicate that the MaxLength property causes client side limits only on
| single line textboxes.

You cannot. Recommended way is to use validator.
 
S

S. Justin Gengo

Mark,

It is documented that MaxLength only works while a text box is in single
line mode.

However, you may use a regular expression validator to control the length
of the text box. I have sample code for this on my web site:
www.aboutfortunate.com. Just go to the code library and search for: "text
area length validation".

I hope this helps.

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top