473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Limit to 150 characters in multi-line textbox

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
Nov 17 '05 #1
4 4357
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.

"Mark" <fi**************@umn.edu> wrote in message
news:uS*************@TK2MSFTNGP10.phx.gbl...
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

Nov 17 '05 #2
| 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.

--
Michal A. Valasek, Altair Communications, http://www.altaircom.net
Please do not reply to this e-mail, for contact see http://www.rider.cz
Nov 17 '05 #3
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
"Mark" <fi**************@umn.edu> wrote in message
news:uS*************@TK2MSFTNGP10.phx.gbl...
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

Nov 17 '05 #4
Take a look @ Recent tips and tricks Validating MaxLength of the TextArea using CustomValidator Topic:http://www.aspnet101.com/aspnet101/tips.aspx

"Mark" <fi**************@umn.edu> wrote in message news:uS*************@TK2MSFTNGP10.phx.gbl...
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



Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Pikkel | last post by:
i'm looking for a way to replace special characters with characters without accents, cedilles, etc.
3
by: CajunCoiler \(http://www.cajuncoiler.tk\) | last post by:
I've seen no reference to this in the MSDN library, so I ask here... what is the known upper limit for the RichTextbox control? And when this limit is exceeded, what error is generated?
5
by: Jesper Rønn-Jensen | last post by:
I have a textarea that must be limited to 70 characters. No big deal -- at least so I thought. * Textarea must not exceed 70 characters * Exceeding content must be cut off * Must work on input by...
2
by: SJM | last post by:
In some VBA code I am building an SQL string to append a new record to a table. The string involves 40 fields. What I am finding is that it works with 39 fields but when I add 40 it fails with the...
5
by: Mitchell Thomas | last post by:
I am using Oracle as a backend and have a field set as Varchar2(2000). The problem i have is access interprets this as a memo field and allows the user to type more than 2000 characters but does...
3
by: ken | last post by:
Hi, I was wondering how the 4k table record limit is counted. I have access 2k. I text fields are 256 chars. Memo fields are not included in the calculation. What about yes/no fields would that be...
1
by: HopfZ | last post by:
Internet Explorer 6 bookmarklets(favlets) has size limit. And its size limit depend on the kind of code. For example, CODE A and CODE B (below) are both at their size limit. CODE A does not work...
4
by: Derty | last post by:
Any way to limit the length of databound text on a datalist itemtemplate?
198
by: Antoninus Twink | last post by:
Or, just how low has this group sunk? Twice in the past couple of days, Default Loser has accused Chris Hills, member of the ISO C committee, of being a troll (though given that the former's...
2
by: =?Utf-8?B?Q2hyaXMgRGF2b2xp?= | last post by:
I thought there was a limit of characters passed on the URL in asp.net of 1100 characters. I sent 1426 characters and it worked. Is there a limit of number of characters on the URL that you can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.