aspdotnet-suresh offers articles and tutorials,csharp dot net, articles and tutorials,VB.NET Articles,Gridview articles,code examples of 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

jQuery Set Maxlength for Multiline Textbox in

Dec 19, 2013

Here I will explain how to set maxlength for multiline textbox in using
jQuery or set of maxlength for multiline textbox in jQuery.
In previous articles I explained
jQuery disable right click on images, jQuery expand textbox on focus , jQuery slideup slidedown slidetoggle example, jQuery fadein or fadeout example, jQuery create rounded corners for textbox, jQuery show time in webpage and many articles relating to JQuery. Now I will explain how to set maxlength for multiline textbox in using jQuery.

To implement this we need to write the code like as shown below

<html xmlns="">
<title>jQuery set maxlength for multiline textbox in</title>
<script type="text/javascript" src="">
<script type="text/javascript">
$(function() {
$('#txtdesc').keypress(function(e) {
var txt = $(this).val();
if (txt.length > 50) {
<form id="form1" runat="server">
<b>Enter Text:</b>
<asp:TextBox ID="txtdesc" TextMode="MultiLine" runat="server" ></asp:TextBox>

Live Demo

Enter Text:

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest,, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email


vj said...

It is useful...thanks

Anonymous said...


Anonymous said...

This wont work in IE if you copy paste the data

Anonymous said...

set property onpaste="return false" for text box

Hemant Chauhan said...

Its Good. But After Writing Data in TextBox we can not select writing data means Ctrl+A Not Appear. So Please Gime Solution for that.

ashutosh shukla said...

it's not working sometime in asp textboxs

Anonymous said...

its not working in case of cut and paste.

Give your Valuable Comments

Other Related Posts

© 2015 All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.