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> 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 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 :) 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
Archived
This topic is now archived and is closed to further replies.