﻿// JScript File

function textCounter(field,cntfield,maxlimit){
    if (field.value.length > maxlimit) {// if too long trim it!
       field.value = field.value.substring(0, maxlimit);
       cntfield.style.backgroundColor = '#FB0000';
       cntfield.style.Color = '#FFF';
    }else{ // otherwise, update 'characters left' counter
       cntfield.value = maxlimit - field.value.length;
       cntfield.style.backgroundColor = '#EBEBE4';
       cntfield.style.Color = '#ACA899';
    }
}
