// JavaScript Document// Form checking elementsfunction fcheck() {	var reg = new RegExp("^.+@.+\\..+$","g"); // Regular expression to test email address. Test it with if (!reg.test(email))	var missing = ""; // List of fields not completed. If it's empty by the end of the test, all fields have been completed (doh!)	// Get form field values	var company = document.contactpartners.company.value.length;	var name = document.contactpartners.name.value.length;	var telephone = document.contactpartners.telephone.value.length;	//var email = document.contactpartners.email.value;		// Test the form values	if (company == 0) {		missing += 'Company\n';	}	if (name == 0) {		missing += 'Name\n';	}	if (telephone == 0) {		missing += 'Telephone\n';	}		if (missing.length) {			var err = 'You must complete the entire form.\n\nThe following fields have not been completed : \n\n'+missing;		alert(err) ;	} else {		document.contactpartners.submit() ;	}}
