View Full Version : Passing hidden form fields info to another form
Chamark
05-02-2009, 01:10 AM
I have a Web dropdown form that has a list of names that is supplied by an SQL statement (Select name. ID, class). The ID, & class info needs to be passed to another form along with the name field when user selects the name from the dropdown list and presses the submit button. How do I send the ID & class along with the name to the other form.
Any help is appreciated
Old Pedant
05-02-2009, 03:21 AM
<select name="whatever">
<%
Set RS = conn.Execute("SELECT name, id, class FROM table")
Do Until RS.EOF
name = RS("name")
value = name & "##" & RS("id") & "##" & RS("class")
%>
<option value="<%=value%>"> <%=name%> </option>
<%
RS.MoveNext
Loop
RS.Close
%>
</select>
Then, in the page that <form> posts to:
<%
...
temp = Split( Request("whatever"), "##" )
name = temp(0)
id = temp(1)
theClass = temp(2) ' class is a keyword and can't be used as variable name
...
%>
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.