View Full Version : validating fields with radio buttons

12-18-2006, 04:31 PM
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:

fuction val()
var regexp = /^.*?_theWord$/;
for (var i=0;i<document.myform.elements.length;i++) {
if (regexp.test(document.myform.elements[i].name) {
alert("Field value is required");
return false;