function characterCount(field,count,maxchars){if(field.value.length>maxchars){field.value=field.value.substring(0,maxchars);alert("Error:\n\n- You are only allowed to enter up to "+maxchars+" characters.");}else{count.value=maxchars-field.value.length;}}