DamienRoche Posted February 25, 2009 Share Posted February 25, 2009 Not sure where this should go. Will probably be moved... I have this code that constructs my radio buttons: <?php while($fetcha = mysql_fetch_array($answers)){ ?> <div class="survey-a-wrap"><div class="ansback"> <input <?php if($selqid == $fetcha['ansid']){echo "checked='checked' ";}?> class="radbut" type="radio" name="<?php echo $qid; ?>" value="<?php echo $fetcha['ansid']; ?>"/> <?php echo $fetcha['answer'];?></div></div> <?php } ?> No need to tutor me on my style of coding. This suits my needs when using ide's. Any way, as you can see, I have a conditional that if true has the radio button pre-selected. The problem is, I can't seem to change the value on *any* pre-selected radio button. I've even checked by dumping all POST,GET & REQUEST variables but my new selection, other than the pre-selected one isn't submitted. Any ideas? Thanks. Link to comment https://forums.phpfreaks.com/topic/146835-can-you-change-a-pre-selected-radio-button/ Share on other sites More sharing options...
phpdragon Posted February 25, 2009 Share Posted February 25, 2009 change echo "checked='checked' "; to echo "checked";} Link to comment https://forums.phpfreaks.com/topic/146835-can-you-change-a-pre-selected-radio-button/#findComment-770920 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.