
//
// 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()
{

// is homeowner?

if (!document.loans.homeowner.checked)
     {
     alert("In order to get a loan you must be a homeowner. Please confirm it by checking the box on the top of the form.")
     return
     }

// title

if (document.loans.title.value.search(/^.+.+$/))
     {
     alert("Please make sure you have included your title!")
     return
     }

// first name

if (document.loans.first_name.value.search(/^.+.+$/))
     {
     alert("Please make sure you have included your name!")
     return
     }

// last name
		 
if (document.loans.last_name.value.search(/^.+.+$/))
     {
     alert("Please make sure you have included your last name!")
     return
     }
	
// home phone
		 
if (document.loans.Home_Telephone.value.search(/^.+.+$/) && document.loans.Work_Telephone.value.search(/^.+.+$/) && document.loans.Mobile_Telephone.value.search(/^.+.+$/))
     {
     alert("Please make sure you have included at least one telephone number")
     return
     }		 
		 
// understand data protection act

if (!document.loans.understandterms.checked)
     {
     alert("Please confirm that you have red and agree with Data Protection Act.")
     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.

else
    {
//		alert("You have filled out the form correctly!")
		document.loans.submit()
		return
		}
}


