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!

Select/Option: Display several columns concatenated but submit just 1?

Status
Not open for further replies.

jamesdboggs

Technical User
Jun 16, 2003
3
US
I have one table that contains a select box that currently displays email addresses (after selecting an email domain from a first select list) that can be selected from a list, using a query to the database table on the email column. Is there a way to display other column value with the email address so users can see them all in the select box, but still have only the email address submitted when selected? My current code below desn't quite work, attempting to use a concatenated string winds up submitting the whole string, not just the email field.

<td width=&quot;80&quot; rowspan=&quot;5&quot; valign=&quot;top&quot; align=&quot;center&quot;>

<%
getUsers = &quot;Select user_id , email, frst_nm, midl_nm, lst_nm, dept, company), from user_profile where email_domain = '&quot; & strDomain & &quot;' order by user_id &quot;
set rsgetUsers=MCATS.execute(getUsers)
%>

<select size=&quot;20&quot; width=&quot;75&quot; name=&quot;srcList&quot; multiple onkeypress=&quot;entsub()&quot; onDblCLick=&quot;javascript:addSrcToDestList()&quot;>

<% DO UNTIL rsgetUsers.eof%>

<option value=&quot;<%= rsgetUsers(&quot;email&quot;) %>&quot;>

<%= rsgetUsers(&quot;user_id&quot;) + rsgetUsers(&quot;frst_nm&quot;) + rsgetUsers(&quot;midl_nm&quot;) + rsgetUsers(&quot;lst_nm&quot;) + rsgetUsers(&quot;dept&quot;) + rsgetUsers(&quot;company&quot;)
%>

</OPTION>

<%rsgetUsers.movenext
LOOP
%>

</SELECT>
</TD>

 
You said something about trying a concatenated string. Did you try this:

Code:
<option value=&quot;<%= rsgetUsers(&quot;email&quot;)  %>&quot;><%=concatString%>

This way, the text is what you want to show, but the value is still just the email address;

--Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top