dvayne Posted April 4, 2008 Share Posted April 4, 2008 In a registration form of mine the user selects the state they live in with a drop-down menu. In the 'Update' form I would like their previous choice to automatically display its selection. For example if my profile displays "Arkansas" my update form should be already display "Arkansas" in the the select menu, but I keep getting 'None Selected'? I can make the data display correctly using <input type='text' ... but can't get the select tag to work. Any help is greatly appreciated! Link to comment https://forums.phpfreaks.com/topic/99625-editing-profile-select-menu/ Share on other sites More sharing options...
bryan52803 Posted April 4, 2008 Share Posted April 4, 2008 Please post what you have. The best way would be to set the value's of each option to a number <option value="1">Arkansas</option><option value="2">Alabama</option> Then, when they submit, get the value chosen, compare it to each value as you're generating the list, and if theres a match add : selected="selected" : to the option parameters. Bryan Link to comment https://forums.phpfreaks.com/topic/99625-editing-profile-select-menu/#findComment-509654 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.