Hello,
I am creating a form. In this form I have this section with several options (radio buttons). Now I made it mandatory to select an option using the if statement. However, when I click 'ok' on the alert box, the message is still being sent. Here is the code:
if (!form.taskIssue[0].checked && !form.taskIssue [1].checked && !form.taskIssue[2].checked &&
!form.taskIssue[3].checked && !form.taskIssue[4].checked && !form.taskIssue[5].checked &&
!form.taskIssue[6].checked && !form.taskIssue[7].checked) {
alert("Please select an option for the 'Task/Issue' field. Thank you.");
return true;
}
I am creating a form. In this form I have this section with several options (radio buttons). Now I made it mandatory to select an option using the if statement. However, when I click 'ok' on the alert box, the message is still being sent. Here is the code:
if (!form.taskIssue[0].checked && !form.taskIssue [1].checked && !form.taskIssue[2].checked &&
!form.taskIssue[3].checked && !form.taskIssue[4].checked && !form.taskIssue[5].checked &&
!form.taskIssue[6].checked && !form.taskIssue[7].checked) {
alert("Please select an option for the 'Task/Issue' field. Thank you.");
return true;
}