Jump to content

You have "x" amount of characters remaining?


Solarpitch

Recommended Posts

Hey, Try this out...

The JS[code]<script>
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;
}
</script>[/code]

The HTML[code]<textarea name="profile" cols="50" rows="10" id="profile" wrap="virtual" onKeyDown="textCounter(this.form.profile,this.form.remLen,300);" onKeyUp="textCounter(this.form.profile,this.form.remLen,300);"></textarea> *</div>
<input readonly type=text name=remLen size=3 maxlength=3 value="300" ID="Text1">(characters left)[/code]

Hope this helps you out.
-Chris

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.