I want an alert (reminder) box to pop up when the "no" radio button is selected on my form. Currently what happens is that the alert box pops up when the "no" button is selected and also when the "yes" button is selected. I dn't want it to pop up when "yes" is selected. Evidentally, I'm overlooking something. The following is my code. Any suggestions would be appreciated.
<script language="Javascript" type="text/javascript">
<!--
function isGood(form) {
if (!document.formcheck.followup.yes) {
alert("Please enter your phone number or email address so that we can contact you.");
return false;
}
return true;
}
// -->
</script>
====================================
Here's the code for the radio button I'm referring to:
<tr valign="top">
<td colspan="2"><strong>May we contact you for follow-up?</strong>
<label for="Follow-up"><input type="radio" name="followup" value="yes" id="Follow-up"> Yes</label>
<label for="No follow-up"><input type="radio" name="followup" value="no" id="No follow-up" checked> No </label>
</td>
</tr>
<script language="Javascript" type="text/javascript">
<!--
function isGood(form) {
if (!document.formcheck.followup.yes) {
alert("Please enter your phone number or email address so that we can contact you.");
return false;
}
return true;
}
// -->
</script>
====================================
Here's the code for the radio button I'm referring to:
<tr valign="top">
<td colspan="2"><strong>May we contact you for follow-up?</strong>
<label for="Follow-up"><input type="radio" name="followup" value="yes" id="Follow-up"> Yes</label>
<label for="No follow-up"><input type="radio" name="followup" value="no" id="No follow-up" checked> No </label>
</td>
</tr>