Since IE 8 doesn’t support the attribute maxlength, we need to use java script to workout this functionality. We can write the script as follows.
<textarea id="clm_add_lin_dta" maxlength="80" name="clm_add_lin_dta" style="resize:none;" onchange="testLength(this,80)" onkeyup="testLength(this,80)" onpaste="testLength(this,80)"></textarea>
<script>
function testLength(ta,maxLength ) {
if (ta.value.length > maxLength) {
ta.value = ta.value.substring(0, maxLength);
}
}
</script>
You must be logged in to post a comment.