View Complete Thread | FoxWeb Forum Home
Search:
Date:    Msg ID:   
From:    Thread:   
Subject:   
THANKS A LOT. IT WORKS GREAT!
Sent by FoxWeb Support on 06/05/2006 03:00:37 PM:
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
support@foxweb.com 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.
 

<%cUser=Allt(Auth.UserID)

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

into Cursor curUser

 

cState=Allt(State)

 

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

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

 

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

 

Endif

%>

 

<select size="1" name="State" value="<%=cState%>">
   <option>AK</option>
   <option>AL</option>
   <option>AR</option>
   <option>AZ</option>
   <option>CA</option>
   <option>CO</option>
   <option>CT</option>
......

   </select>

 

 

 
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.
 
Larry