I am inserting data to a database through a dropdown menu!
The code looks simply like this:
<SELECT NAME='Country'>
<?php echo "<OPTION SELECTED>$Country</OPTION>" ?>
<OPTION selected = "selected">Sweden</OPTION>
<OPTION>Ireland</OPTION>
<OPTION>Denmark</OPTION>
<OPTION>England</OPTION>
</SELECT>
If this was just a pure dropdown list, there would be no empty option in the dropdown list.
However it seems the <?php echo.... adds an empty row to the dropdown list. This means I am forced to validate this since the field in the database requires some input.
The easiest thing I can think of though is to somehow avoid that the <?php echo... adds this empty row. Does anyone know if this can be done in a simple way?
Thanks a lot / Åsa