Forum Moderators: open
Also, what attribute do I use to limit the number of characters that can be typed into the textarea box? And can I have a little box next to it that counts down the characters like the Cingular text message site?
Here are my values that correlate with the values that are in your suggested code:
document = not sure (do I just leave this as is?)
formName = Custom Quote (does it matter if there is a space?)
textareaName = Special Instructions (Again, space OK?)
value='' = Do I put a value there? If so, what?
I tried coding it exactly as you coded it, and also as I did below, and neither work:
<textarea cols="50" rows="5" maxlength="125" wrap="physical" onfocus="document.Custom Quote.Special Instructions.value='';">Type any Special Instructions here including exact quantities of any items for which you selected 10+ or 15+</textarea>
Also, do you know how to limit the amount of characters that one can type in the textarea box? maxlength="150" did not work.
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
countfield.value = maxlimit - field.value.length;
}
// End -->
</script>
<!-- textCounter() parameters are: text field, the count field, max length -->
<form name="myform" method="post" action="">
<font size="1" face="arial, helvetica, sans-serif"> ( You may enter up to 125 characters. )<br>
<textarea name=message wrap=physical cols=28 rows=4 onKeyDown="textCounter(this.form.message,this.form.remLen,125);" onKeyUp="textCounter(this.form.message,this.form.remLen,125);"></textarea>
<br>
<input readonly type=text name=remLen size=3 maxlength=3 value="125"> characters left</font>
</form>