HOME BLOG PORTFOLIO PHOTO CONTACT Admin Login
Text counter while writing

Count how many text you have pressed

//remaining text function
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if the current length is more than allowed
field.value =field.value.substring(0, maxlimit); // don't allow further input
else
countfield.value = maxlimit - field.value.length;
}

<input type="text" class="inputBox" name="phone" onKeyPress="return validate_for_integers(this, event)" onKeyDown="textCounter(this.form.phone, this.form.remLen5,15);"
onkeyup="textCounter(this.form.phone, this.form.remLen5,15); "/>
<input name="name" type="text" class="inputBox" id="name" onKeyDown="textCounter(this.form.name, this.form.remLen,63);"
onkeyup="textCounter(this.form.name, this.form.remLen,63);"/>
&amp;amp;nbsp;<input name="remLen" type="text" id="remLen" value="63" size="3" maxlength="3" class="inputBox" disabled="disabled"/>

   Share on Facebook

Page views:399