jim.davidson Posted September 14, 2009 Share Posted September 14, 2009 On my update member page the value stored in my table for a radio button doesn't register. the value is "yes" but the yes button doesn't highlight. What am I missing? Here's the code <td><div align="left"> <input <?php if (!$_POST && !(strcmp($row_GetMember['county_relief'],"yes"))) { echo "checked=\"checked\""; } elseif ($_POST && !(strcmp($_POST['county_group'],"yes"))){ echo "checked=\"checked\""; } ?> name="county_group" type="radio" class="text_background" value="yes" id="county_yes"/> <label for="county_yes">Yes</label> <input <?php if (!$_POST && !(strcmp($row_GetMember['county_relief'],"no"))) { echo "checked=\"checked\""; } elseif ($_POST && !(strcmp($_POST['county_group'],"no"))){ echo "checked=\"checked\""; } ?> name="county_group" type="radio" class="text_background" id="county_no" value="no" /> <label for="county_no">No</label></div> </td> Any help will be appreciated Link to comment https://forums.phpfreaks.com/topic/174213-populating-a-radio-button-not-working/ Share on other sites More sharing options...
jim.davidson Posted September 15, 2009 Author Share Posted September 15, 2009 I figured it out myself <td><div align="left"> <label> <input <?php if (!$_POST && !(strcmp($row_GetMember['county_relief'],"yes"))) {echo "checked=\"checked\"";} elseif ($_POST && !(strcmp($_POST['county_group'],"yes"))) {echo "checked=\"checked\"";} ?> name="county_group" type="radio" value="yes" id="county_yes" /> <label for="county_yes">Yes</label> <input <?php if (!$_POST && !(strcmp($row_GetMember['county_relief'],"no"))) {echo "checked=\"checked\"";} elseif ($_POST && !(strcmp($_POST['county_group'],"no"))) {echo "checked=\"checked\"";} ?> name="county_group" type="radio" id="county_no" value="no" /> <label for="county_no">No</label> </div> </td> Link to comment https://forums.phpfreaks.com/topic/174213-populating-a-radio-button-not-working/#findComment-918870 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.