Hi, I have this function: function limitText(limitField, limitCount, limitNum) { if (limitField.value.length > limitNum) { limitField.value = limitField.value.substring(0, limitNum); } else { limitCount.value = limitNum - limitField.value.length; } } Code (markup): <textarea name="desc" onKeyDown="limitText(this.form.desc,this.form.countdown,500);" onKeyUp="limitText(this.form.desc,this.form.countdown,500);">Testing</textarea><br> You have <input readonly type="text" name="countdown" size="3" value="500"> characters left. Code (markup): The only problem with it though is if there is already text within the field it will not count this until you start typing. Is there any way to count the text that is already in there. Cheers, Adam
I think you are facing this problem only when you come to the page with text already in textarea(name="desc"). Simple solution is call the 'limitText' function 'onload' of the page 'body' tag.