Hi people!

I have a form that I want to validate, and thus I use the following script:

function validate_required(field,alerttxt)
{with (field)
{if (value==null||value=="")
{alert(alerttxt);return false}
else {return true}
}
}

function validate_form(thisform)
{with (thisform)
{if (validate_required(firstname,"msg!")==false)
{firstname.focus();return false}
else if (validate_required(lastname,"msg!")==false)
{lastname.focus();return false}
else if (validate_required(address,"msg!")==false)
{address.focus();return false}
else if (validate_required(area,"msg!")==false)
{area.focus();return false}
else if (validate_required(city,"msg!")==false)
{city.focus();return false}
else if (validate_required(postalcode,"msg!")==false)
{postalcode.focus();return false}
}
}


But i also want to check if the telephone number is in 10-digit form, and i add the following:

function validate_required_tel(field,alerttxt)
{with (field)
{
if (field.value.length!="10")
{alert(alerttxt);return false}
else {return true}
}
}

function validate_form(thisform)
{with (thisform)
{
if (validate_required_tel(cellphone,"msg!")==false)
{cellphone.focus();return false}
}
}


My problem is that any of the two scripts works fine on it's own, but when used together (in the same validation.js page) the first controls are skipped, and only the telephone control works.

Any ideas??