[eluser]Todlerone[/eluser]
Hello everyone and thank-you in advance. I have a form that submits to the database as planned. What I'm trying to do is allow for editing of the information after submitted. The problem I'm having is setting the conditions of my check boxes to what was originally set. My code seems to always set No. I can see why it does it, just not sure how to correct it.
Code:
<label for="ReferralImaging">Referral Imaging:</label>
<?php if ($pt['Referral_ct'] == 'Yes'){ ?>
<?php echo "<input type=\"checkbox\" name=\"Referral_ct\" value=\"Yes\" checked />CT";?>
<?php }else{ ?>
<?php echo "<input type=\"checkbox\" name=\"Referral_ct\" value=\"No\" />CT";}?>
<?php if ($pt['Referral_mri'] == 'Yes'){ ?>
<?php echo "<input type=\"checkbox\" name=\"Referral_mri\" value=\"Yes\" checked />MRI";?>
<?php }else{ ?>
<?php echo "<input type=\"checkbox\" name=\"Referral_mri\" value=\"No\" />MRI";}?>
<?php if ($pt['Referral_mrisrs'] == 'Yes'){ ?>
<?php echo "<input type=\"checkbox\" name=\"Referral_mrisrs\" value=\"Yes\" checked />MRI SRS";?>
<?php }else{ ?>
<?php echo "<input type=\"checkbox\" name=\"Referral_mrisrs\" value=\"No\" />MRI SRS";}?><br/>
TY again