﻿function submitForm() {
    var strValid = "";

    //  Form Validation 
    if ( document.contactform.Name.value == "" ) { strValid = strValid + "- Name" + "\n" };
    if ( document.contactform.Address1.value == "" ) { strValid = strValid + "- Address" + "\n" };
    if ( document.contactform.PostCode.value == "" ) { strValid = strValid + "- Postal Code" + "\n" };
    if ( document.contactform.Telephone.value == "" ) { strValid = strValid + "- Telephone" + "\n" };
    if ( document.contactform.Email.value == "" ) { strValid = strValid + "- Email" + "\n" };
    if ( document.contactform.Request.value == "" ) { strValid = strValid + "- Request/Comment" + "\n" };

    //  Submit the form if it is valid
    if ( strValid == "" ) {
        document.contactform.submit();
    } else {
        alert( "Please complete the following field(s):\n\n" + strValid );
    }
}