I'm new to PHP and I'm working on a form in my admin area. I have a list of the 50 states in a standard drop down menu form.
My problem is that when I go in to edit the form, my list of states defaults back to Alabama, which is at the top of the list.
All of my other fields call in the correct information, because theyare text fields, as opposed to a drop down menu.
Is there anyway to have it echo in the state that had been previously chosen? I use the full name of the state in the drop down, but I only record and display the two letter abbreviation of each state.
Here's my code. I'm only putting a few states, but I think you'll get the point.
<select name="state">
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
</select>
Thanks for any help.
ccooper