<asp:TextBox ID="txtValue" runat="server" TextMode="MultiLine" Rows="10" Columns="50"></asp:TextBox>
$(document).ready(function()
{
var MaxLength = 250;
$('#txtValue').keypress(function(e)
{
if ($(this).val().length >= MaxLength) {
e.preventDefault();}
});
});

Well, all you need to do is to place a label below the textbox with the default text as "Allowed only 250 characters."
<asp:Label ID="lblCount" runat="server" Text="Allowed only 250 characters." Font-Size="Smaller" Font-Names="Arial"> </asp:Label>Now, to show how many characters end user has entered, we will use keyup() event of multiline textbox. This event will take the count of currently entered characters in textbox and modifies the value of the label.
$('#txtValue').keyup(function()
{
var total = parseInt($(this).val().length);
$("#lblCount").html('Characters entered <b>' + total + '</b> out of 250.');
});
Simple and cool, isn't it? See live Demo and Code.
Feel free to contact me for any help related to jQuery. I will gladly help you.


