Show number of inputing charecter in textbox.
use this script
<script language="JavaScript">
function textCounter(field, cntfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
else
cntfield.value = maxlimit - field.value.length;
}
</script>
and call like this...
onkeyup="textCounter(this,id of textbox where you want to show,250)"
onkeydown="textCounter(this,id of textbox where you want to show,250)"
<script language="JavaScript">
function textCounter(field, cntfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
else
cntfield.value = maxlimit - field.value.length;
}
</script>
and call like this...
onkeyup="textCounter(this,id of textbox where you want to show,250)"
onkeydown="textCounter(this,id of textbox where you want to show,250)"
Comments
Post a Comment