Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to validate a group of radio buttons in NN ?

Status
Not open for further replies.

rlatham

Programmer
Aug 23, 2000
51
US
Please, help me. I know very little Javascript. [sadeyes]
I want to validate a group of radio buttons and if the NO (position 1) is selected then the Selection box 4 has to be answered also. Here is my code, it works in IE, but NN.
Thanks ahead for your help.

if (!(frmForm.q3[0].checked || frmForm.q3[1].checked)){
N=frmForm.q3.value;
window.alert("Please answer question 3");
return false;
}
if (frmForm.q3[1].checked && z4.value == "choose one") {
alert("Please Answer Question 4");
z4.focus();
return false;
}

if (frmForm.q3[1].checked && z4.value == "Other" && document.frmForm.q4.value=="") {
alert("Please Answer specify 'Other' in Question 4");
z4.focus();
return false;
}

[lipstick2]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top