I have a form and I have to add state name field with a drop down so the user can select name of the state they want from that select box.
How can I do this?
I have a form and I have to add state name field with a drop down so the user can select name of the state they want from that select box.
How can I do this?
Assuming you have a databse like mysql.
iterate in your option of the select box using php script example:
<select name="state">
<?php
*// At this point you should have a recordset $rsstate which fetches all the records from the state table*
while($rowState = mysql_fetch_array($rsState)){?>
<option value=<?php echo $rowState["state_abbr"]?>><?php echo $rowState["state_name"]; ?></option>
<?php }?>
</select>