Forum Moderators: coopster
How are radio boxes validated with php?
Part of my form gives a choice of 4 credit cards, and one has to be selected, but I don't have a clue as to how to validate it. Actually I've checked one by default to avoid validating, but I'm wondering how to validate if one wasn't checked initially.
<tr>
<td class="right">Payment Method:</td>
<td><input name="Payment" type="radio" value="Visa" checked>
Visa
<input type="radio" name="Payment" value="MasterCard">
MasterCard
<input type="radio" name="Payment" value="Discover">
Discover
<input type="radio" name="Payment" value="Amex">
American Express</td>
</tr>
<tr>
<td> </td>
<td><input name="Card_Method" type="radio" id="Card_Method" value="Card_On_File" checked>
Please use my credit card on file<br>
<input name="Card_Method" type="radio" id="Card_Method" value="Card_Will_Call">
I will call with my credit card information</td>
I'm validating the text fields like so:
if ($Name == "")
{
$name_err = "<font color=red>Please enter your name.</font><br>";
$send = "no";
}
etc.
and with a little help with an earlier post, that's working fine.
Any help would again be appreciated...
Thanks!