Visually indicate to the user when the textbox limit has been exceeded

Total Post:102

Points:714
C# 
 1076  View(s)
Ratings:
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>

  1. Post:194

    Points:1396
    Re: Visually indicate to the user when the textbox limit has been exceeded

    Try this 

    $("#Txtbox").on('input',function () {
        if($(this).val().length == $(this).attr('maxlength')) {
            $(this).css('background-color','red');
        }
    });

      Modified On Apr-07-2018 01:56:32 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!