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>
Comments
Post a Comment