If Radio Button is selected, perform validation on Checkboxes

前端 未结 4 1547
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-03 12:05

I\'m trying to work this form so when the first radio button is selected, run a certain validation. When the second radio button is selected, run a different validation, etc

4条回答
  •  轮回少年
    2021-01-03 12:50

    You must use the equals operator not the assignment like

    if(document.form1.radio1[0].checked == true) {
        alert("You have selected Option 1");
    }
    

提交回复
热议问题