I have a members database and wish to give them a form where they can amend their details, so I need to populate the form with what is already in the database.
I have successfully created the form and can populate text fields with ...value= <? echo... etc.
However I have one form field which is an option list and I want the option which is in the database to be selected.
The HTML is simply to put the word 'selected' in the <option> tag. So I thought for each option I would put:
<option value="thisopt" <? if ($var="thisopt"): echo("selected") endif;?> >
obviously changing "thisopt" to the value of the particular option tag.
Grateful to be pointed in the right direction... 🙂
3v