Forum Moderators: open
It is for a user profile update module, so if they want to update their information, the information they have already inputted to the database will be in the form, they just have to edit the bits they need.
I have done the normal text boxes, but I can't seem to find a solution for the pull down menus!
Any more ideas? and thanks for replying.
W.
I don't know what server language you are using, so I'll use PHP in the example.
EXAMPLE
$user_stat = "C"; //the user's current setting
$dropdown = "<select name=\"something\">";
$values = array("A", "B", "C", "D");
foreach ($values as $val) {
$selected = ($user_stat == $key)? " selected=\"\"selected" : "";
$dropdown .= "<option value=\"".$val."\".$selected.">".$val."</option>";
}
$dropdown .= "</select>";
print $dropdown;