echo "<td>Language</td>";
echo "<td><select id='language' name='language'>
<option value=''>Select...</option>
<option value='en_US'>English(US)</option>
<option value='en_AU'>English(AU)</option>
<option value='en_US'>English(UK)</option>
</select>
</td>";
I have that code snip enclosed in a form to post of a php file and when i choose to submit the form, I can see those options. However, after i click a button to save what I have selected, the language above is always set to the first option (en_US) no matter what ever.
You’ll need to check your last submitted value to determine which option should receive the
selectedattribute. You’re currently not doing this, so the browser sets the first option as the selected one.Demo: http://codepad.org/PkwNYHbO