//application form validation
function checkData(){
	var amount_to_borrow = document.getElementById("amount_to_borrow");
	var app1_email_address = document.getElementById("app1_email_address");
	
	if(amount_to_borrow.value == " " || amount_to_borrow.value == "\t" || isNaN(amount_to_borrow.value)){  //check to see if field is empty
		alert("Please enter the amount to borrow");
		amount_to_borrow.focus();	//not valid, so set focus to correct field
		return false;  //stops the form being submitted
	}
//you only get here if the amt to borrow is valid
	else if (app1_email_address.value == " " || app1_email_address.value == "\t" || !isNaN(app1_email_address.value)){  //check if last name field is empty
		alert("Please enter your email address");
		app1_email_address.focus();  //set focus to last name
		return false;	
	}
//you only get here if amount and email have been entered

		return true;	//allows form to be submitted	

}

//contact form validation
function contactData(){
	var name = document.getElementById("name");
	var email = document.getElementById("email");
	var phone = document.getElementById("phone");
	
	if(name.value == " " || name.value == "\t" || !isNaN(name.value)){  //check to see if field is empty
		alert("Please enter your name");
		name.focus();	//not valid, so set focus to correct field
		return false;  //stops the form being submitted
	}
//you only get here if the name is valid
	else if (email.value == " " || email.value == "\t" || !isNaN(email.value)){  //check if email field is empty
		alert("Please enter your email address");
		email.focus();  //set focus to last name
		return false;	
	}
//you only get here if name and email have been entered
	else if (phone.value == " " || phone.value == "\t" || isNaN(phone.value)){  //check if last name field is empty
		alert("Please enter your phone number");
		phone.focus();  //set focus to last name
		return false;	
	}

		return true;	//allows form to be submitted	

}