I have fields that need to be validated and the below checks all my radio button selections so If I check a radio button the unchecked ones for that field are still validated. Please advise how I can check radio buttons so it doesnt still show "Field value is required" even after I checked the button for a field:
Code:
fuction val()
{
var regexp = /^.*?_theWord$/;
for (var i=0;i<document.myform.elements.length;i++) {
    if (regexp.test(document.myform.elements[i].name) {
        if(!document.myform.elements[i].checked)
        {
            alert("Field value is required");
            return false;
        }
    }
}