
//	This code solves problem of Radio Buttons and Checkboxes not sending any 
//	data to the ASP code, thus leaving the columns out of sync.


oldField = "none"
noneChecked = true
isRadio = false
function setValue(theForm){

//	Loop through each field on the form

	for (i=0;i<theForm.length;i++){

//	See if radio button field names are repeated and check if 
//	any choices were selected.

		if (oldField == theForm[i].name){
			isRadio = true
			if (theForm[i].checked || theForm[i-1].checked){
				noneChecked = false
			}
		}
		else{

//	If no radio button was selected, select one and set it to blank

		    if (isRadio){
			if (noneChecked){
				
				theForm[i-1].value=""
				theForm[i-1].checked = true
			}
		    }
		    
//	Look for unchecked Checkboxes.  If found, check it and set it to blank

		if (theForm[i].type == "checkbox"){
			if (theForm[i].checked == false){
				theForm[i].checked = true
				theForm[i].value = ""
			}
		}

//	Reset values for next loop

			oldField = theForm[i].name
			noneChecked = true
			isRadio = false
		}

	
	}
	return true


}
