Main Topics
Browse All TopicsYikes, I have a web control:
<asp:textbox ID="mytext" TextMode="MultiLine" MaxLength="3500" runat="server"/>
but when JavaScript is turned off, the textbox will not limit user input. However, a single line textbox will limit user input to the specified MaxLength.
Why is this and how to fix? I really need it to work with JavaScript turned off. Is putting a validation control the only way to sort of control it?
Thanks.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
The <asp:TextBox> control maps to the html <input type='text'> for small text entries and the html <textarea> field for large entries. When a MaxLength is applied, it creates a size attribute on the <input> tag, but the <textarea> tag does not have a HTML maxlength (rows & cols attributes only specify the window size of textarea).
In order to specify the maximum length, you will need to either use server side validation, or javascript. You can either do it manually, or use the <asp:LengthValidator> control. I would recommend the lengthvalidator, because it has the ability to do BOTH server and client(javascript) validation.
Business Accounts
Answer for Membership
by: arif_eqbalPosted on 2007-01-08 at 23:28:45ID: 18273752
Hi champ_010 for that
Yes for a Multiline TextBox you need either some JavaScript or a Validation Control
I used RegularExpressionValidator