
function sendForm()
{	
	// Keeps track if there were any required fields left empty
	var textBoxError = false;
	var radioError = true;
	
	// Retrieving all the text boxes -- 1-5, 7 are required
	var inputs = document.getElementsByTagName('input');	
	
	for( var i = 0; i < inputs.length; i++ )
	{
		if(inputs[i].id == 'required'){ // the id attriubute of the required text boxes are set as "required"			
			if( inputs[i].value == ""){
				inputs[i].style.backgroundColor = "#ff9393";
				textBoxError = true;			
			}else
				inputs[i].style.backgroundColor = "white";
		}					
	}
	
	// Retrieve the description length radio buttons -- one is requried to be chosen
	var requiredRadios = document.getElementsByName('desc_length');
	
	for( var i = 0; i < requiredRadios.length; i++ )
	{
		// Cycles through the required radios and changes the radio error to false if it finds any radios checked then breaks out of loop
		if( requiredRadios[i].checked ){			
			radioError = false;
			break;
		}		
	}
	
	if(radioError){		
		document.getElementById('radioCell').style.backgroundColor = "#ff9393";		
	}else{
		document.getElementById('radioCell').style.backgroundColor = "white";
	}
	
	if( textBoxError || radioError ){
		alert('Please fill out all required fields before proceeding.');
	}else{
		document.forms['myForm'].submit();
		//alert('submitting...blah blah blah');
	}
	
}