secretsquirrel
Programmer
i've got a form which, when filled out incorrectly, displays the form again populating the fields with what the user submitted.
it's easy enough for most of my fields...
...etc.
the problem i've got is that i don't know how to display a drop down menu with a specific value selected, based on a users submission. obviously i can do the following...
...but this won't work dynamically. it's almost as if i need to write <select name="title" selected="<?=$title?>">, but that's clearly gibberish!
does anyone know how i can achieve this?
thanks in advance,
ss...
it's easy enough for most of my fields...
Code:
<input name="firstName" value="<?=$firstName?>">
...etc.
the problem i've got is that i don't know how to display a drop down menu with a specific value selected, based on a users submission. obviously i can do the following...
Code:
<select name="title">
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Miss" selected>Miss</option>
...but this won't work dynamically. it's almost as if i need to write <select name="title" selected="<?=$title?>">, but that's clearly gibberish!
does anyone know how i can achieve this?
thanks in advance,
ss...