
//
// Verification script
//
// copyright © 2003 agitprop_mainman
//
// This is a free script by agitprop_mainman that is  released under the
// Open Source Software copyright conventions.
//
// Please note that NO technical assistance is  offered with this script.
//
//--------------------------------------------------------------------------
//
//Paste the script into the head of your page

function verify()
{
// This section just uses a simple regular expression to check the name
// input box. It checks for one or more characters, a space and another
// group of characters.


// name

if (document.form.restaurant_name.value.search(/^.+.+$/))
	{
	alert("Please make sure you have included restaurant name.")
	return
	}

// card address1

if (document.form.address01.value.search(/^.+.+$/))
	{
	alert("Please make sure you have included restaurant address.")
	return
	}

// card city

if (document.form.city.value.search(/^.+.+$/))
	{
	alert("Please make sure you have included restaurant city.")
	return
	}

// card county

if (document.form.county.value.search(/^.+.+$/))
	{
	alert("Please make sure you have specified restaurant county.")
	return
	}

// card region

if (document.form.region.value.search(/\d/))
	{
	alert("Please make sure you have specified restaurant country.")
	return
	}




// card postcode
/*
if (document.form.postcode.value.search(/^.+.+$/))
	{
	alert("Please make sure you have included restaurant postcode.")
	return
	}
*/

// card telephone

if (document.form.tel.value.search(/^.+.+$/))
	{
	alert("Please make sure you have specified restaurant's telephone number.")
	return
	}

// contact name

if (document.form.contact_firstname.value.search(/^.+.+$/))
	{
	alert("Please make sure you have included your first name.")
	return
	}

// contact surname

if (document.form.contact_surname.value.search(/^.+.+$/))
	{
	alert("Please make sure you have included your surname.")
	return
	}

// contact position

if (document.form.contact_position.value.search(/^.+.+$/))
	{
	alert("Please make sure you have included your position.")
	return
	}

// confirm_on_behalf

if (document.form.confirm_on_behalf.checked == false)
	{
	alert("Please make sure you have specified that you act on behalf of the restaurant.")
	return
	}
		 
// This section also uses a regular expression to check the email  input box.
// It checks for one or more characters, then it checks for the email @
// signifier, then another group of characters, then a full stop or period (.),
// then for another group of characters.

//if (document.form.email.value.search(/^.+@.+\..+$/))
//	{
//	alert("Please include a valid email address!")
//	return
//	}

else
	{
// If the form is correctly filled out you can submit the form to your mail cgi
// by deleting the next line, and uncommenting the following two lines.
	document.form.submit()
	return
	}
}
