Ask a Question related to ASP.NET General, Design and Development.
-
alien2_51 #1
Is this an MS bug..?
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...?
alien2_51 Guest
-
Karl Seguin #2
Re: Is this an MS 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
"alien2_51" <dan.billow@n.o.s.p.a.m.monacocoach.com> wrote in message
news:OmLg4BYQDHA.2432@TK2MSFTNGP10.phx.gbl...> 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...?
>
>
Karl Seguin Guest
-
Calvin Bottoms #3
Re: Is this an MS bug..?
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
"alien2_51" <dan.billow@n.o.s.p.a.m.monacocoach.com> wrote in message
news:OmLg4BYQDHA.2432@TK2MSFTNGP10.phx.gbl...> 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...?
>
>
Calvin Bottoms Guest
-
alien2_51 #4
Re: Is this an MS bug..?
Thanks.... makes very much sense....
"alien2_51" <dan.billow@n.o.s.p.a.m.monacocoach.com> wrote in message
news:OmLg4BYQDHA.2432@TK2MSFTNGP10.phx.gbl...> 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...?
>
>
alien2_51 Guest
-
Vidar Petursson #5
Re: Is this an MS bug..?
Hi
What about ( Does not work on all browsers.... better check onsubmit/Server
also.)
myTextArea.Attributes.Add("onkeydown","if(this.val ue.length >=255) return
false");
--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================
"alien2_51" <dan.billow@n.o.s.p.a.m.monacocoach.com> wrote in message
news:OmLg4BYQDHA.2432@TK2MSFTNGP10.phx.gbl...> 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...?
>
>
Vidar Petursson Guest



Reply With Quote

