View Complete Thread | FoxWeb Forum Home
Date:    Msg ID:   
From:    Thread:   
The SELECT element does not take a VALUE attribute, but rather relies on the keyword SELECTED in the OPTION elements to specify a default option:
<select size="1" name="State">
   <option <%=IIF(cState=="AK", "selected", "")%>>AK</option>
   <option <%=IIF(cState=="AL", "selected", "")%>>AL</option>
   <option <%=IIF(cState=="AR", "selected", "")%>>AR</option>

FoxWeb Support Team email

Sent by Larry Zhang on 06/05/2006 09:18:34 AM:
Oops, no question over the past month.
I used an option dropdown list to display "State" in a user table.


Select * from user where lower(UserID)=cUser;

into Cursor curUser




IF LOWER(Request.Form("UserForm")) = "user_edit"

    M.state = Request.Form('state')


    Select User
    UPDATE User;
      SET State = M.state,;
        WHERE Upper(UserID) = cUser





<select size="1" name="State" value="<%=cState%>">




I can update the State value of the User table based on the user selection on the screen. But when I pulled out the same record, the value returns to the first option of the selection list.
When displaying the old record, how can I let the selection list points to the value of the User table, not the first selection as a new record?
Thank you in advance.