function checkTextLength(obj,restrictLength,truncFlag)
{
if(obj.value.length>restrictLength){
if(truncFlag) obj.disabled = true;
alert(“Text should not be more than ” + restrictLength + ” characters”);
if(truncFlag) obj.disabled = false;
obj.focus();
if(truncFlag) obj.value = obj.value.substring(0,restrictLength);
return false;
}else{
return true;
}
}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.