HTML select based off of user info for state

paulaplum

New Member
\[code\]<select name="state" class="input-small" selected="<? if(isset($_SESSION['user'])){ echo $row_login['state']; }?>"> <option value="http://stackoverflow.com/questions/13812189/AL">AL</option> <option value="http://stackoverflow.com/questions/13812189/AK">AK</option> <option value="http://stackoverflow.com/questions/13812189/AZ">AZ</option> <option value="http://stackoverflow.com/questions/13812189/AR">AR</option> <option value="http://stackoverflow.com/questions/13812189/CA">CA</option>\[/code\]I am creating a user profile edit section and need the users pre-selected state to show up as the list default. How can I manage to do this? Preferably something that doesnt involve jquery because it seems like there should be a simple solution to this problem. Thanks!
 
Back
Top