About Me

Professional Practical HumanBeing

Wednesday, November 17, 2010

Limiting the Number of Characters in a MultiLine TextBox

for TextBox onkeypress="javascript:CheckLengthStatus(this);" if 16000 is the max limit

function CheckLengthStatus(X) {
try {
var length = document.getElementById(X.id).value.length

if (length < 16000)
{ }
else
{ window.event.keyCode = 0; }
}
catch (e) { }
}

No comments:

Post a Comment