I am using the following code to validate radio buttons. it work fine as long as i have more than one record returned from my recordset that creates the radio buttons dynamically. When I have one record in the recordset, this code fails... any help would be appreciated.
function validateSelect(form){
var return_var = false
myOption = -1;
for (i=0; i<document.process_form.select_record.length; i++) {
if (document.process_form.select_record[i].checked) {
myOption = i;
alert("my Option = " + MyOption);
}
}
if (myOption == -1) {
alert("You must select a Product Usage record to Update.");
return false;
} else {
return_var = true
}
}