I'm using an adaptation of PHPBB to create a drop-down list.
<select name="destination_path">
<!-- BEGIN path -->
<option value="{path.DESCRIPTION}">{path.DESCRIPTION}</option>
<!-- END path -->
</select>
The list is generated from a MySQL query, so it is dynamic. This list is within a form and when the form is fired I want to retain (and return) it's state in session variables. My first thought was to place something in the <select> statement.
I know you can use:
selected="option_selected"
in the relevant <option>, but it seems like a messy way to do this and would require an if statement to compare each tag as the tag is created.
Is there a way to declare the default option in the select tag, or a better defined method to achieve the same result?