i have written the javascript to limit the max characters and count them and even do paste and delete options and nothing works in fire fox but works fine in IE can any one please help me with this problem.
<i> </i><script type="text/javascript"> function checkLength(len, cnter, parnt){ if (len > 255) { alert ("Maximum length exceeded"); parnt.value=parnt.value.substr(0,255); len = parnt.value.length; } document.getElementById(cnter).innerHTML= (len)+" characters used, "+(255-len)+" characters remaining"; } </script>
[code=html] <textarea name="comments" rows="5" cols="60" onkeyup="checkLength(this.value.length, 'comlength', this)" ></textarea> <br> <span id="comlength" style="font-size:xx-small"></span> [/code]
Help @rvintha spread the word by sharing this article on Twitter...