Textarea(Multi-line textbox) Maxlength validation.

Posted by vishalneeraj-24503 under ASP.NET category on | Points: 40 | Views : 512
In Multi-line textbox ,MaxLength property does not work ,i.e. TextArea does not validate maxlength property value.So,here is very simple things to be done for Multi-line text box.
On the onkeypress event ,we have to write return this.value.length<=9. So it will accept value till 10 digit .Below is an example:-

<asp:TextBox ID = "txt_summary" runat = "server" 
onkeypress = "return this.value.length<=9" TextMode = "MultiLine"
Width = "100%"></asp:TextBox>

Comments or Responses

Login to post response