function textCounter(field, countfield, maxlimit) {

/*

* The input parameters are: the field name;

* field that holds the number of characters remaining;

* the max. numb. of characters.

*/

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;} // set the display field to remaining number
