
function formValidator(){
	// Make quick references to our fields
	var source_id = document.getElementById('source_id');
	var destination_id = document.getElementById('destination_id');
	var vehicle_id = document.getElementById('vehicle_id');
	
	
	// Check each input in the order that it appears in the form!
	if(madeSelection(source_id, "Please Choose a Source")){
					if(madeSelection(destination_id, "Please Choose a Destination")){
						if(madeSelection(vehicle_id, "Please Choose a Vehicle")){
							return true;
						}
					}
				}
			
	
	
	return false;
	
}


function madeSelection(elem, helperMsg){
	if(elem.value == ""){
		alert(helperMsg);
		elem.focus();
		return false;
	}else{
		return true;
	}
}

/*function formValidator(){
	
	 valid = true;

	if ( document.frmsearch.source_id.selectedIndex == 0 )
    {
        alert ( "Please select your source." );
        valid = false;
    }
	if ( document.frmsearch.destination_id.selectedIndex == 0 )
    {
        alert ( "Please select your Destination." );
        valid = false;
    }
	if ( document.frmsearch.vehicle_id.selectedIndex == 0 )
    {
        alert ( "Please select your vehicle." );
        valid = false;
    }
	if ( ( document.frmsearch.one_way_fare[0].checked == false )
    && ( document.frmsearch.one_way_fare[1].checked == false ) )
    {
        alert ( "Please choose your Fare: One Way or Return" );
       valid = false;
    }
	
			  
	
return valid;
		
}*/







