Is this an MS bug..?

A

alien2_51

I have a ASP.Net TextBox in singleline mode, maxlength prevents the user
from entering more than maxlength either by not allowing you to input more
chars or removing text to the end beginning at max length... If I change
mode to multiline I'm able to put as much text as I like regardless of the
maxlength I specify...

Is this a bug...?
 
K

Karl Seguin

no....<asp:textbox TextMode="Multiline".../> gets rendered as an html
<textarea></textarea> which, unline the html <input type="text".../> does
not support a maxlength property. There are ways, using Javascript to limit
the length however.

as such, it's a limitation of HTML...which all webcontrols must map to.

Karl
 
C

Calvin Bottoms

No, it's just a limitation of HTML. A multi-line textbox is implemented as a
textarea, which has no maxlength property. You'll have to validate the input
yourself using a RegularExpressionValidator or some other means.

Calvin
 
V

Vidar Petursson

Hi

What about ( Does not work on all browsers.... better check onsubmit/Server
also.)

myTextArea.Attributes.Add("onkeydown","if(this.value.length >=255) return
false");

--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================
 

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

Top