I'm trying to use asp:
<asp:TextBox ID="txtInput" runat="server" TextMode="MultiLine"></asp:TextBox>
and i want a way to specify the maxlength property ,but apparently there is not such for multiline textbox. I've been trying to use some javascript for the onkeypress event onkeypress="return textboxMultilineMaxNumber(this,maxlength)"
function textboxMultilineMaxNumber(txt, maxLen) {
try {
if (txt.value.length > (maxLen - 1)) return false;
} catch (e) {
}
return true;
}
while working fine the problem with this javascript function is that after writing characters it doesn't allow you to delete and substitute any of them, such a behavior is not desired.
Have you got any idea what can i possibly change in the above code to avoid that or any other ways to get round it. Thank you!!