Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box - Selecting Value Through Code

Status
Not open for further replies.

FontanaS

Programmer
May 1, 2001
357
US
Hi!

I have a combo box on a form. I want to check to see if the user is logging in as a guest. If they are then I want to have the word guest show up in the combo box selected.

This is what I have -

<select name="ComboUserName"><option></option>
<%IF lvUserType = "GU" THEN%>
<option>Guest</option>
***How Do I Select It Here?***
<%END IF%>

THANKS!
 
Do you only want the Guest option to show when they are a guest? If so, then try this:
Code:
<select name="ComboUserName"><option></option>
<%IF lvUserType = "GU" THEN%>    
    <option [COLOR=red]value="Guest" selected[/color]>Guest</option>
         ***How Do I Select It Here?***
<%END IF%>
If you want Guest to show all the time but only be selected when they are a guest, then just put the "selected" part within your if/end if statement.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top