Scorpion28 Posted December 28, 2011 Share Posted December 28, 2011 What am I doing wrong with this selected radio button? <form action="Process/privacy.php" method="post" enctype="multipart/form-data" id="privacy"> <div id="privacy_vis">Your profile is visible to:</div> <div id="privacy_select"> <label> <input name="RadioGroup1" type="radio" id="RadioGroup1_0" value="1" <?if($visible=="1")echo 'checked="checked"';?> /> Everyone</label> <label> <input name="RadioGroup1" type="radio" id="RadioGroup1_1" value="0"/> Members Only</label> </div> <br /> <div id="privacy_vis">Your Password to view your private pictures is:</div> <div> <input name="pictures_pw" type="text" id="pictures_pw" value="<? echo "$xxx_pw" ?>" size="50" maxlength="20" /> </div> <br /> <div> <input name="submit" type="submit" class="button" id="submit" value="Save Changes" /> </div> </form> </div> Quote Link to comment https://forums.phpfreaks.com/topic/253964-radio-button/ Share on other sites More sharing options...
peter_anderson Posted December 28, 2011 Share Posted December 28, 2011 What is the problem you're experiencing? Quote Link to comment https://forums.phpfreaks.com/topic/253964-radio-button/#findComment-1301896 Share on other sites More sharing options...
Scorpion28 Posted December 28, 2011 Author Share Posted December 28, 2011 it's not echoing the selected item Quote Link to comment https://forums.phpfreaks.com/topic/253964-radio-button/#findComment-1301900 Share on other sites More sharing options...
Scorpion28 Posted December 28, 2011 Author Share Posted December 28, 2011 This is the error Parse error: syntax error, unexpected '=', expecting ',' or ';' in /homepages/6/d365637117/htdocs/EE Live/Active/privacy.php on line 64 Quote Link to comment https://forums.phpfreaks.com/topic/253964-radio-button/#findComment-1301901 Share on other sites More sharing options...
peter_anderson Posted December 28, 2011 Share Posted December 28, 2011 Change the PHP to: <?php if($visible=="1") echo 'checked="checked"'; ?> Not tested, but it should work. Quote Link to comment https://forums.phpfreaks.com/topic/253964-radio-button/#findComment-1301912 Share on other sites More sharing options...
Scorpion28 Posted December 28, 2011 Author Share Posted December 28, 2011 Thanks it worked Quote Link to comment https://forums.phpfreaks.com/topic/253964-radio-button/#findComment-1301923 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.