This is in the head:
This is the form:
The issue is that the textarea where I plan to use this script doesn't live inside a form tag. And, as you can see, one of the arguments being passed in is the "this.form" .
I need the form info for the ELSE of the function. Any suggestions? Adding a form tag is not recommended for me at the moment.
THANKS!
Code:
<script language="javascript" type="text/javascript">
function limitText(limitField, limitCount, limitNum) {
if (limitField.value.length > limitNum) {
limitField.value = limitField.value.substring(0, limitNum);
} else {
limitCount.value = limitNum - limitField.value.length;
}
}
</script>
Code:
<form name="myform"> <textarea name="limitedtextarea" onKeyDown="limitText(this.form.limitedtextarea,this.form.countdown,100);" onKeyUp="limitText(this.form.limitedtextarea,this.form.countdown,100);"> </textarea><br> <font size="1">(Maximum characters: 100)<br> You have <input readonly type="text" name="countdown" size="3" value="100"> characters left.</font> </form>
I need the form info for the ELSE of the function. Any suggestions? Adding a form tag is not recommended for me at the moment.
THANKS!
Comment