herando Posted June 13, 2006 Share Posted June 13, 2006 Objective - to update table records via form field.If I have text field, the field remembers the value in such way:<input name="object" type="text" value=" <? echo $rows['object']; ?> "/>How to remember the value of List/Menu field?<select name="object"><option selected="selected">--- choose ---</option><option value="0">Beer</option><option value="1">Wine</option><option value="2">Vodka</option></select> Quote Link to comment https://forums.phpfreaks.com/topic/11853-how-to-remember-listmenu-value/ Share on other sites More sharing options...
joquius Posted June 13, 2006 Share Posted June 13, 2006 on each option add this<? if ($_POST['object'] == $value) echo "selected=\"selected\""; ?> // $value being the value="num" of the option Quote Link to comment https://forums.phpfreaks.com/topic/11853-how-to-remember-listmenu-value/#findComment-44944 Share on other sites More sharing options...
herando Posted June 13, 2006 Author Share Posted June 13, 2006 thanx :) Quote Link to comment https://forums.phpfreaks.com/topic/11853-how-to-remember-listmenu-value/#findComment-44969 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.