Pages

Saturday, October 30, 2010

MaxLength for MultiLine textbox
onKeyUp="javascript:Count(this,5000);" onChange="javascript:Count(this,5000);"
function Count(text,long)
{
var maxlength = new Number(long); // Change number to your max length.
if(document.getElementById('txtDescription').value.length > maxlength)
{
text.value = text.value.substring(0,maxlength);
alert(" Only " + long + " chars");
}
}

No comments:

Post a Comment

Search This Blog