Limit to 150 characters in multi-line textbox

  • Thread starter Thread starter Mark
  • Start date Start date
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
 
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.
 
| 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.
 
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
 
Back
Top