function Length_TextField_Validator()
{
// Check the length of the value of the element named text_name
// from the form named form_name if it's < 3 and > 10 characters
// display a message asking for different input
if ((emailform.AreaCode.value.length < 3) || (form_name.text_name.value.length > 3))
{
// Build alert box message showing how many characters entered
mesg = "You have entered " + emailform.AreaCode.value.length + " character(s)\n"
mesg = mesg + emailform.AreaCode.name + " must be three numbers.\n"
mesg = mesg + "Please verify your input and submit again."
alert(mesg);
// Place the cursor on the field for revision
emailform.AreaCode.focus();
// return false to stop further processing
return (false);
}
// If text_name is not null continue processing
return (true);
}