// JavaScript Document

//button.onclick = function () {     = not great because it requires using the button only, ignores the keyboard. so use onsubmit
$("#myForm").submit(function(){
	
	if($("#parent").val() == "") {
		$("#parent_error").html("This field is required");
	} else {
		$("#parent_error").html("");
	}
	
	
	if($("#student").val() == "") {
		$("#student_error").html("This field is required");
	} else {
		$("#student_error").html("");
	}
	
	
	if($("#grade").val() == "") {
		$("#grade_error").html("This field is required");
	} else {
		$("#grade_error").html("");
	}
	
	
	/*if($("#phone").val() == "") {
		$("#phone_error").html("This field is required");
	} else {
		$("#phone_error").html("");
	}*/
	
	/*if($("#hearus").val() == "") {
		$("#hearus_error").html("This field is required");
	} else {
		$("#hearus_error").html("");
	}*/
	
	
	/*if($("#comments").val() == "") {
		$("#comments_error").html("This field is required");
	} else {
		$("#comments_error").html("");
	}*/
	
	if($("#parent").val()=="" || $("#student").val()=="" || $("#grade").val()=="" || $("#phone").val()=="" || $("#hearus").val()=="" || $("#comments").val()==""){
		return false;
	}
	//if either field is blank do not submit form
	
});
