lioslios Posted February 11, 2012 Share Posted February 11, 2012 guys i have this dropdown menu echo "<form method=\"post\" action=\"\">"; echo "<center><select name=\"mydropdown\" size=\"0\" style=\"height:4em; width:15em;\">"; echo "<option value=\"Milk1\">{$_SESSION['tem1']}</option>"; echo "<option value=\"Milk2\">{$_SESSION['tem2']}</option>"; echo "<option value=\"Milk3\">{$_SESSION['tem3']}</option>"; echo "</select></center>"; echo "</form>"; and i wand to update a variable every time i select one of the contents... how can i done this??? Quote Link to comment https://forums.phpfreaks.com/topic/256861-drop-down-selection-to-variable/ Share on other sites More sharing options...
MMDE Posted February 11, 2012 Share Posted February 11, 2012 You either need to write some javascript along with some JQuery, or else you need a submit button (<input type="submit" value="submit" />) You can get the data if they submit their selection with a submit button when the submit button refresh the site with this variable: $_POST['mydropdown'] Quote Link to comment https://forums.phpfreaks.com/topic/256861-drop-down-selection-to-variable/#findComment-1316865 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.