-Log in
-Register (free)


-RSS Feeds
-New MyDesk Module
-Update to Profile

Fashion Buy Bulk Discount Designer Handbags from D
Handbags UK Designer Style Handbag fashioned buy h
fashion women cross necklaces stores.cheap discoun




 Forums /

passing multiple values through a dropdown box
alberte | Posted 12:55am 6. July 2009 Server Time |

My Code

<select name="CustUserID" size="1" onChange="jpsjsRefreshPg('CustID');">
<%
SQL = "SELECT Planning.[Client Name], Planning.[Camp Type] FROM Planning"

RS.Open SQL, connStr, 3, 3
Response.Write "<OPTION Value="""">-Select Media Type-</OPTION>"
do until RS.eof
response.write "<option value=""" & RS("Camp Type") & """>"
response.write RS("Camp Type")
response.write "</option>"
RS.movenext
loop
RS.close
%>
</select>


The value thats being passed for CustUserID is that off
RS("Camp Type") and it works.

My question is how to also pass the value of RS.[Client Name] from the SQL query to the data collection page?

Thank you all in advance
ronmuir | Posted 0:41am 20. July 2009 Server Time |

<option value="<%=RS("Camp Type")%>:<%=RS("Client Name")%>"><%=RS("Camp Type")%>
</option>

Then on your data processing page you can do something like:

myValArray = Split(request.form("D1"),":")

therefore
myValArray(0) = Camp Type
myValArray(1) = Client Name

Not very elegant! You need to consider rationalising your database so you pass:

<option value="<%=RS("CampID")%>"><%=RS("Camp Type")%>
</option>

then on your data processing page do a lookup on your database of CampID and find which clients this relates to.

Does that make sense!

R
1
Show all replies to 'passing multiple values through a dropdown box'
To post a message to this discussion you need to be
a Haneng.com member. If you already are a member please log in
if not register as a member here (free).



| Info |
© Copyright 1997-2010 Alexander Haneng