Syntax help.
Posted: Mon Jul 05, 2004 9:13 pm
This is pretty basic, but I've never done it before and am not familiar with the syntax. I'm trying to create a list menu that has the state/provincial abbreviations, but I'd like to have the default value appear based on a value from a recordset. I don't think I have the syntax right. I've done this with input boxes, but seem to be stuck on the list menu. I've left out most of the state values to facilitate the ease of reading the code...
Here's the code:
Thanks!
Here's the code:
Code: Select all
<?php
echo "\n<tr>";
echo "\n\t<td><h3>";
echo "State";
echo "</td><td>";
echo "<select name=",state," value='";
echo $row['state'];
echo "'><option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AS">American Samoa</option>
<option value="AZ">Arizona</option>
</select>";
echo "</h3></td>";
echo "</tr>";
?>