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
Reply to Post passing multiple values through a dropdown box
|
|
|