Darkwoods Posted October 25, 2010 Share Posted October 25, 2010 Hey in my edit page i have 2 radio buttons in my form and i need to make sure the same value is still selected how can i do that? thanks Link to comment https://forums.phpfreaks.com/topic/216774-how-to-display-selected-radio-button-from-mysql-data/ Share on other sites More sharing options...
vichu.1985 Posted October 25, 2010 Share Posted October 25, 2010 Dude, Try with this <form name="test" action="submit.php" method="post"> <?php $selected = 1; // it will be queried value if($selected == 1){ echo '<INPUT TYPE=RADIO NAME="size" VALUE="1" CHECKED >one<BR> <INPUT TYPE=RADIO NAME="size" VALUE="2">two<BR>'; } else{ echo '<INPUT TYPE=RADIO NAME="size" VALUE="1">one<BR> <INPUT TYPE=RADIO NAME="size" VALUE="2" CHECKED >two<BR>'; } ?> </form> Link to comment https://forums.phpfreaks.com/topic/216774-how-to-display-selected-radio-button-from-mysql-data/#findComment-1126171 Share on other sites More sharing options...
Darkwoods Posted October 25, 2010 Author Share Posted October 25, 2010 thanks this is great Link to comment https://forums.phpfreaks.com/topic/216774-how-to-display-selected-radio-button-from-mysql-data/#findComment-1126173 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.