jaylearning Posted December 13, 2007 Share Posted December 13, 2007 Hi! thanks for looking. i cant seem to work out how to get my drop down menu to select the value that has been selected when submiting. please help me im so new to this i cant work it out i looked at so many tutorials. <select name="autoplay"><? if ($myrow["autoplay"] == "1") { echo '<option value="0">No</option> <option value="1" selected="selected">Yes</option>'; } else { echo '<option value="0" selected="selected">No</option> <option value="1">Yes</option>'; } ?> </select> Quote Link to comment Share on other sites More sharing options...
marcus Posted December 13, 2007 Share Posted December 13, 2007 $sel = ($myrow['autoplay'] == '1') ? " SELECTED" : ""; echo "<select name=\"autoplay\">\n"; echo "<option value=\"0\">No</option>\n"; echo "<option value=\"1\"".$sel.">Yes</option>\n"; echo "</select>\n"; Quote Link to comment 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.