// -- JavaScript for checking required fields in paypal feedback forms --

//
// next set clicked button to blank 
var clicked_button = "";

function CheckRequiredFields(form_name) {

// dump any variable for checking next
// alert('NOTE:' + form_name);
// return false; 

// next if "view cart" button was clicked then skip edit and submit form
if (clicked_button == "view" ) {
return true; 
}

var errormessage = new String();
// Put field checks below this point.

if(WithoutSelectionValue(form_name.os0))
	{ errormessage += "\n\nPlease select a class from the dropdown list."; }
if(WithoutContent(form_name.os1.value))
	{ errormessage += "\n\nPlease type a first name \"First Name\" text field."; }
if(WithoutContent(form_name.os2.value))
	{ errormessage += "\n\nPlease type something in the \"Last Name\" text field."; }
if(WithoutContent(form_name.os3.value))
	{ errormessage += "\n\nPlease enter a valid date of birth mmddyyyy."; }
if(WithoutContent(form_name.os5.value))
	{ errormessage += "\n\nPlease enter a valid home phone number."; }


// Put field checks above this point.
if(errormessage.length > 2) {
	alert('NOTE:' + errormessage);
	return false;
	}
return true;
} // end of function CheckRequiredFields()


function WithoutContent(ss) {
if(ss.length > 0) { return false; }
return true;
}

function WithoutSelectionValue(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].selected) {
		if(ss[i].value.length) { return false; }
		}
	}
return true;
}

// --
