Set Maxlength to Multiline Textbox using J-Query

Set Maxlength to Multiline Textbox using J-Query


<head runat="server">
    <title></title>
    <script>
        function Check(textBox, maxLength) {
            if (textBox.value.length > maxLength) {
                alert("You cannot enter more than " + maxLength + " characters.");
                textBox.value = textBox.value.substr(0, maxLength);
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="TxtNotes" runat="server" Rows="2" TextMode="MultiLine" Width="450px"
            TabIndex="8" Height="100px" onkeyup="javascript:Check(this, 1000);" onchange="javascript:Check(this, 1000);"></asp:TextBox>
    </div>
    </form>
</body>


It will look like :-



Comments

Popular posts from this blog

Create and save QR code in asp.net with C#

Change text of RadGrid Header Dynamically

Telerik Radwindow Open on Button Click