scripts/menu.js
/**
 * Validate the Menu Form Fields have been filled in correctly
 * @param {Object} form The HTML DOM Menu Form Element
 */
Validate the Menu Form Fields have been filled in correctly
@param {Object} form The HTML DOM Menu Form Element
Validate the Menu Form Fields have been filled in correctly @param { Object } form The HTML DOM Menu Form Element
function submitForm(form) {
	$("#submitForm").prop("disabled", true);
	formErrorStatus = false;
	checkSelectedValue(form.route, $("#noRouteSelected"));
	checkSelectedValue(form.model, $("#noModelSelected"));
	checkSelectedValue(form.method, $("#noMethodSelected"));
	simulationInitialization();
	reenableSubmitButton();
}
function submitForm ( form ) { $ ( "#submitForm" ) . prop ( "disabled" , true ) ; formErrorStatus = false ; checkSelectedValue ( form . route , $ ( "#noRouteSelected" ) ) ; checkSelectedValue ( form . model , $ ( "#noModelSelected" ) ) ; checkSelectedValue ( form . method , $ ( "#noMethodSelected" ) ) ; simulationInitialization ( ) ; reenableSubmitButton ( ) ; }
Validate the Menu Form Fields have been filled in correctly
 @param {Object} form The HTML DOM Menu Form Element
Validate the Menu Form Fields have been filled in correctly @param { Object } form The HTML DOM Menu Form Element
//Immediately disable the submit button so the user can't double click it (which would cause two instances of the same simulation to run) //Reset the formErrorStatus for the current validation attempt //Perform validation on the entered values of each section (Route, Model and Travel Method) //Initialize the simulation //Re-enable the Submit Button