Home > DeveloperSection > Forums > Visually indicate to the user when the textbox limit has been exceeded
Mark Devid
Mark Devid

Total Post:101

Points:707
Posted on    December-02-2014 10:28 PM

 ASP.Net C# 
Ratings:


 1 Reply(s)
 581  View(s)
Rate this:

I am new asp.net now I need to visually indicate to the user when the textbox limit exceeded. Please give a solution.

 

<asp:TextBox ID="Txtbox" runat="server" Height="50px" TextMode="MultiLine"

        Width="150px" MaxLength="50"></asp:TextBox>



Kamlakar Singh
Kamlakar Singh

Total Post:194

Points:1396
Posted on    December-03-2014 6:53 AM

Try this

 

$("#Txtbox").on('input',function () {

    if($(this).val().length == $(this).attr('maxlength')) {

        $(this).css('background-color','red');

    }

});


Don't want to miss updates? Please click the below button!

Follow MindStick