|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
MaxLenth doesn't workWhy the TextBox’s MaxLength property set to a positive number doesn’t work
when the TextMode property is set to Multiline? What can I do to get both properties work? -- __________________ Luis Graillet Ramos You probably have to manage this using a JavaScript function that is
triggered onKeyPress. Something like this: <script type="text/javascript"> function CheckBoxLength(maxLen) { var txtBox = window.event.srcElement; if (txtBox.value.length > maxLen) { alert("MaxLength has reached"); event.returnValue=false; event.cancelBubble = true; } } </script> <asp:TextBox ID="txtMultiLine" Runat="server" TextMode="MultiLine" Width="400px" Rows="5" onkeypress="CheckBoxLength(80)"></asp:TextBox> Show quoteHide quote "gralet" wrote: > Why the TextBox’s MaxLength property set to a positive number doesn’t work > when the TextMode property is set to Multiline? What can I do to get both > properties work? > -- > __________________ > Luis Graillet Ramos For completness this is because a multiline textbox is rendered as a
textarea tag. This HTML tag doesn't have this attribute. This is likely usually tested client side (see the other response). -- Show quoteHide quote"gralet" <gra***@discussions.microsoft.com> a écrit dans le message de news:72E96296-EBCD-450C-B7D9-8AA6B6B2F2FF@microsoft.com... > Why the TextBox's MaxLength property set to a positive number doesn't work > when the TextMode property is set to Multiline? What can I do to get both > properties work? > -- > __________________ > Luis Graillet Ramos
CustomValidator is not firing
Checkbox in datagrid.... How to read value of a dynamically created radiobuttonlist control? DataGrid Functionality Questions Checkbox state after postback add a list item to a bound control Best way to have multiple pages show up as same selection on menu Dynamic checkbox loses checked state DataGrid Conditional Formatting Simple String Conversion? |
|||||||||||||||||||||||