
//
// 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.FirstName.value.search(/^.+.+$/))
//     {
//     alert("Please make sure you have included your first name.")
//     return
//     }

// surname

//if (document.form.LastName.value.search(/^.+.+$/))
//     {
//     alert("Please make sure you have included your second name.")
//     return
//     }


// contact method

if ( ( document.form.ContactMethod[0].checked == false )
	&& ( document.form.ContactMethod[1].checked == false ) )
	{
	alert ( "Please choose your prefered contact method." );
//	valid = false;
	return
   }


// email 

if (document.form.ContactMethod[0].checked == true)
	{
	if (document.form.Email.value.search(/^.+@.+\..+$/))
		{
		alert("Please include a valid email address.")
		return
		}
	}
	  
		 
// phone

if (document.form.ContactMethod[1].checked == true)
	{
	if (document.form.Telephone.value.search(/^.+.+$/))
		{
		alert("Please make sure you have included your telephone number.")
		return
		}
	}

		 
// message
		 
if (document.form.Message.value.search(/^.+.+$/))
     {
     alert("Please make sure you have included your message.")
     return
     }

// ServiceUnit	
	
if ( document.form.ServiceUnit.selectedIndex == 0 )
	{
	alert ( "Please select a Service Unit." );
	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
     }
}


