I have made a php form that is submitted by email. I am trying to make conditional check boxes so that if one specific check box is selected two others cannot be selected and if one or two of those two check boxes are selected the first one cannot. My code looks like this
<p>Ribeye Steak <input type="checkbox" name="Ribeye steak" value="Ribeye Steak"/> </p>
<p>Ribeye Roast (prime rib) <input type="checkbox" name="Ribeye Roast" value="ribeye roast" /> </p>
<p>Sirloin Steak <input type="checkbox" name="Tenderloin roast" value="Tenderloin roast" /> </p>
<p>T-bone steak <input type="checkbox" name="T-bone" value="T-bone steak" />
or New York Strip steak <input type="checkbox" name="NY" value="New York Strip" />
and/or Tenderloin Filets <input type="checkbox" name="Filets" value="Filets steaks" /> </p>
<?php
if($_GET['T-bone steak'] == 'T-bone steak' AND $_GET['New York Strip'] == 'New York Strip') {
echo "You cannot select T-bone steak and NY Stip or Tenderloin. Please select T-bone or NY Strip and/or Tenderloin.";
} else if($_GET['T-bone steak'] == 'T-bone steak' AND $_GET['Filets steaks'] == 'Filets steaks'){
echo "You cannot select T-bone steak and NY Stip or Tenderloin. Please select T-bone or NY Strip and/or Tenderloin.";
}
else{
}
?>
When the file is opened nothing happens. It still allows me to select any or all three of the checkboxes. Any ideas? Thank a bunch.