I'm web designer w little experience in coding. Working on a form that has fields with check boxes to be checked. How can I include validation for these checkbox array in the validation_required function that I have for other areas?
Here is the code I have so far for the validations in the head for (onSubmit="return validate_form(this)" ) and the code for check boxes area in the body:
_______________________________
javascript Code:
<script type="text/javascript">
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(company_name,"Company name must be filled out!")==false)
{company_name.focus();return false}
if (validate_required(address,"Company address must be filled out!")==false)
{address.focus();return false}
if (validate_required(city,"City must be filled out!")==false)
{city.focus();return false}
if (validate_required(state,"State must be filled out!")==false)
{state.focus();return false}
if (validate_required(zip,"Zip code must be filled out!")==false)
{zip.focus();return false}
if (validate_required(country,"Country name must be filled out!")==false)
{country.focus();return false}
if (validate_required(company_phone,"Phone must be filled out!")==false)
{company_phone.focus();return false}
if (validate_required(company_email,"Company email must be filled out!")==false)
{company_email.focus();return false}
if (validate_required(tax_id_number,"Federal Tax ID Number must be filled out!")==false)
{tax_id_number.focus();return false}
}
}
</script>
________________________________________
This is the checkbox area in the body:
____________________________________
Can someone help me with this?
Much thanks.
