I have a page to edit inforation in a mysql database. It's pretty simple, fields that consit of location name, address, city, state and zip. I have a combo box for state that populates from a query. The states table have 3 columns, ID, statename and stateabbr (aberivations). In the location table, I have a field called stateid which is joined with state table. When using the edit record, it pull up the current info that is stored in the database. Here is the code:
echo "<tr><td>State:</td><td><select name=\"stateid\"><option selected=\"yes\"><value=\"" .$row['stateid']. "\">" .$row[statename]. "</option>";
When I view source, it displays this
<tr><td>State:</td><td><select name="stateid"><option selected="yes"><value="5">CALIFORNIA </option><option value="1">ALABAMA</option><option value="2">ALASKA</option> etc., etc., etc.
When I click the submit, the post value is the statename and not the value shown in the view source. What is causing that? If I modify the state, it works.