I have two radio buttons like so
<input type="radio" name="rush" value="yes" />
<input type="radio" name="rush" value="no" checked="checked" />
What I want to do is when the form submit button is clicked, check if 'yes' is selected.
If it is, show a javascript confirm dialog
I've gotten this far, but am stuck, any help would be appreciated.
$("form.shipping").submit(function() {
if($("input[name='rush']".attr("value") === "yes")
{
if (confirm("Rush orders are subject to an upcharge. (Just wanted to make sure you read the note). Is this ok?"))
{
return true;
}
else
{
return false;
}
}
});