I'm trying to validate some things on this form. (I've omitted some of the totally uneccesary code below. I'm first trying to tackle the "card" radio buttons. When I hit the submit button, it's just sitting on the whole thing. Can't figure out what I'm doing wrong here:
<html>
<head><title>Kahaj's Hardware and More</title>
<script type="text/javascript">
<!-- HIDE FROM IMCOMPATIBLE BROWSERS
window.defaultStatus = "Kahaj's Hardware and More";
function confirmSubmit() {
var cardChoice = false;
for (var i=0; i<2; ++i) {
if (document.forms[0].card[i].checked == true) {
cardChoice = true;
break;
}
}
if (cardChoice = false) {
window.alert("Please select payment method.");
return true;
}
else
return false;
}
function confirmReset() {
var resetForm = window.confirm("Are you sure you want to clear all of the above contents?");
if (resetForm == true)
return true;
return false;
}
// STOP HIDING FROM INCOMPATIBLE BROWSERS -->
</script></head>
<body>
<p><div align="center"><font size="6" face="Garramond">Kahaj's Hardware and More</font></div></p><br /><br />
<p><font size="4">Choose from the items below what you want to order. Be sure to fill in your<br />
personal information. Then, you'll be ready to submit your order.</font></p><br /><br />
<form action="http://localhost/cgi-bin/kahajsHW.cgi" method="post" onreset="return confirmReset();" onsubmit="return confirmSubmit();">
<!************************************BILLING INFO****************************************>
<p><div align="center" /><font size="4" face="Arial"> Billing Information:</font></div></p><br />
<table width="85%" border="0">
<tr>
<td width="24%">
 
</td>
<td width="38%" valign="top">
<font size="3">
<p>Payment method:<br />
<input type="radio" name="card" value="cCard" />Credit Card<br />
<input type="radio" name="card" value="dCard" />Debit Card</p><br />
<p>Card number:<br />
<input type="text" name="cardNumber" size="18" maxlength="16"></p><br />
<p>Expiration date: (mmyy)<br />
<input type="text" name="expDate" size="5" maxlength="4"></p><br />
</td>
<td width="38%" valign="top">
<p>Billing Address:<br />
Street Address 1: <input type="text" name="bAdd1" size="20"><br />
Street Address 2: <input type="text" name="bAdd2" size="20"><br />
City: <input type="text" name="bCity" size="20"><br />
State: <input type="text" name="bState" size="3" maxlength="2"><br />
Zip Code: <input type="text" name="bZip" size="7" maxlength="5"></p><br />
<p>Name as it Appears on Card:<br />
First Name: <input type="text" name="bFirstName" size="10"><br />
Middle Initial (if applicable): <input type="text" name="bMI" size="2" maxlength="1"><br />
Last Name: <input type="text" name="bLastName" size="15"></p><br /><br />
</td>
</tr>
</table><br /><br />
<hr width="85%"><br /><br />
<!**************************************SHIPPING INFO***********************************>
<p><div align="center" /><font size="4" face="Arial"> Shipping Information:</font></div></p><br />
<table width="85%" border="0">
<tr>
<td width="24%">
 
</td>
<td width="38%" valign="top">
<p>Person Being Shipped To:<br />
First Name: <input type="text" name="sFirstName" size="10"><br />
Last Name: <input type="text" name="sLastName" size="15"></p><br />
</td>
<td width="38%" valign="top">
<p>Shipping Address:<br />
Street Address 1: <input type="text" name="sAdd1" size="20"><br />
Street Address 2: <input type="text" name="sAdd2" size="20"><br />
City: <input type="text" name="sCity" size="20"><br />
State: <input type="text" name="sState" size="3" maxlength="2"><br />
Zip Code: <input type="text" name="sZip" size="7" maxlength="5"></p><br />
</td>
</tr>
</table>
<p><input type="reset" value="Clear Form" /> <input type="submit" value="Submit Order" /></p>
</form>
</font>
</body>
</html>