mm00re Posted July 10, 2009 Share Posted July 10, 2009 Hi, I have been having a little trouble getting a radio box or a checkbox to show the value of users and if they have supervisor privileges. It's easy to do with a popup menu however I am trying to keep it as clean as I can. I can echo the $super and the $checked variables and they show correctly but when I try to have it display in the form it's not working. Thanks! $super = $row["dSupervisor"]; $checked = ($super==1) ? 'checked="checked"' : ''; echo $super; echo $checked; //$active = $row["dActive"]; } // Close the SQL connection mysql_close($connection); ?> <strong> <div id="main"> <form action="pr-update.php" method="post"> <label for="dFirstName-l">First Name:</label> <input type="text" name="dFirstName" id="dFirstName-l" value="<? echo ($firstname);?>" /> </br> <label for="dLastName-l">Last Name:</label> <input type="text" name="dLastName" id="dLastName-l" value="<? echo ($lastname);?>" /> </br> <?php echo 'Supervisor?: <SELECT NAME="dSupervisor" SIZE="3" ID="supr"> <OPTION selected="' . $super . '">' . $super . '</OPTION> <OPTION VALUE="Yes" <? if ($super=="Yes"){print "selected=\"selected\"";} ?>Yes</OPTION> <OPTION VALUE="No" <? if ($super=="No"){print "selected=\"selected\"";} ?> No</OPTION>;</SELECT>'; ?> <input type="radio" name="dSupervisor" id="dsupervisor-l" '.$checked.' /> <br /> Link to comment https://forums.phpfreaks.com/topic/165526-query-result-enables-a-checkbox-or-radio-button/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.