Is this an MS bug..?

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