menu??

A

Anonymous

Guest
the problem is the menu can't display the value when I click the edit button from the previous form.

I know the the text field is <value="<? echo $name ?>"> but how about the menu? <select name="State" value="<? echo $state ?>"> ??????
 
the syntax for your Select box is incorrect...
<select name="state">
<option><? echo $state ?></option>
</select>

Andrew
 
in an option tag the parameter selected="selected" preselects that choice so, assuming $state holds the wanted state

Code:
$states_array = array('a','b','c');
while(.......$cnt++.....)
{
echo '<option value="' .$states_array[$cnt]. "';
echo ($state == $states_array[$cnt]) ? ' selected="selected"' : '';
echo '>' .$states_array[$cnt]. '</option>
';
}

to give a basic idea.
 
Back
Top