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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unbound column combobox value

Status
Not open for further replies.

mrgulic

Technical User
Sep 18, 2001
248
US
How do you display the value of the unbound column combobox value asp?

Code:
<select name="Site">
<option selected value="">
<% 
If rsSiteCombo.RecordCount > 0 Then
  rsSiteCombo.MoveFirst			
  Do While Not rsSiteCombo.EOF
%>		
<option value="<%=rsSiteCombo("Site Code")%>"><%=rsSiteCombo("Site Name")%></option>
<%  
  rsSiteCombo.MoveNext 
  Loop
End If
%>
</select>


Site Code = A five digit unique alpha-numeric value
Site Name = The "Common Name" for the Site Code

Example:
Site Code: NL005
Site Name: Tarragona, Spain

The listbox is bound to "Site Code" and "Site Name" is displayed in the dropdown.

I can do a Request.Form("Site") to get the "Site Code" but I don't have a clue as how to get the "Site Name".

Thanks in advance for any help.

BTW: I googled this for 2 hours before posting here.

 
request it from the database or have both in the option value with a delimiter and split them off.

other than that, some javascript to insert the text (not the value) of the selected option into a hidden field.

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top