When I don’t press a radio button it comes up with an alert saying I need to which is what I want but when I do press one it still comes up with that alert, How do I stop that from happening?
IN FUNCTION FIELDCHECK I HAVE WRITTEN:
case “radio_hidden”:
if (fld.value != “1”)/* radio male or female button should be checked
{
fld.valid = true;
}
break;
IN MY FUNCTION VALIDATE FORM I HAVE WRITTEN:
if (frm.radio_hidden.valid == false)
{
report_text += ” You must click a radio button male or female.nn”
}
IN MY HTML CODE THIS IS WHAT I HAVE WRITTEN:
<br><u>Select Your gender:</u><br>
<input type=”radio” name=”rad” value=”” onchange=”radio_hidden.value = 1;”> Male
<br>
<input type=”radio” name=”rad” value=”” onchange=”radio_hidden.value = 1;”> Female
<br>
<input name=”radio_hidden” value=”1″ type=”hidden”>