Dear All,
I have radio buttons on a form. When I press submit, how do I determine on the receiving code which radio button has been selected, since they both have the same name? (Some PHP would be great to demonstrate!)
Many thanks
Mark
How to check which radio button is selected?
Moderator: General Moderators
If they have the same name, then you check the values
Code: Select all
$radio = $_POST['RadioButtonName'];
if ( $radio == "x" ){
//do something
}else[if ($radio=="y"]){
//do something else
}