Forums
This topic is locked
Creating Variable
Posted 18 Aug 2006 21:07:07
1
has voted
18 Aug 2006 21:07:07 Paul Edwards posted:
HiI have created a form with radio buttons in it, i also have sent the results to another page with the get statement and want to send the description and dimentions as well, do i some variables and if so how would i do that so they get sent with the form
here is the code
<form id="products" name="products" method="get" action="cart.asp">
<table width="100%" border="0">
<tr>
<td>Description</td>
<td>Dimentions</td>
<td>Shiplap</td>
<td>Overlap</td>
<td>Treatment</td>
<td>Erect</td>
<td>Cart</td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsApex.EOF))
%>
<tr>
<td><%=(rsapex.fields.item("description".value)%></td>
<td><%=(rsapex.fields.item("dimentions".value)%></td>
<td><input type="radio" id="wood"name="wood" value="<%=(rsapex.Fields.Item("shiplap".Value)%>">
£ <%=(rsapex.Fields.Item("shiplap".Value)%>.00</td>
<td><input type="radio" id="radio" name="wood" value="<%=(rsapex.Fields.Item("overlap".Value)%>" />
£ <%=(rsapex.Fields.Item("overlap".Value)%>.00</td>
<td><input type="radio" id="treatment" name="treatment" value="<%=(rsapex.Fields.Item("treatment".Value)%>">
£ <%=(rsapex.Fields.Item("treatment".Value)%>.00</td>
<td><input type="radio" id="erect" name="erect" value="<%=(rsapex.Fields.Item("erect".Value)%>">
£ <%=(rsapex.Fields.item("erect".Value)%>.00</td>
<td><input type="submit" value="Add To Cart" /></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsApex.MoveNext()
Wend
%>
</table>
</form>
if some one could help please
thankyou
Paul Ed
Replies
Replied 17 Oct 2006 07:25:44
17 Oct 2006 07:25:44 micah santos replied:
of course, you will need to use varaibles. they are very essential, especially when you are sending it to another page.
here's an example:
note: i use POST instead of GET (though, they're much very like the same)
MAIN_FORM.ASP
<form method="post" action="MAIN_CHECK.ASP">
Name<input type="text" name="gb_name"><br>
Email<input type="text" name="gb_email"><br>
<input type=submit value="Submit">
</form>
MAIN_CHECK.ASP
<%
Dim usr_name,usr_email
// get values from MAIN_FORM.PHP
usr_name = Request.Form("gb_name"
usr_email = Request.Form("gb_email"
// display variable's value
response.write usr_name & "<br>"
response.write usr_email
%>
here's an example:
note: i use POST instead of GET (though, they're much very like the same)
MAIN_FORM.ASP
<form method="post" action="MAIN_CHECK.ASP">
Name<input type="text" name="gb_name"><br>
Email<input type="text" name="gb_email"><br>
<input type=submit value="Submit">
</form>
MAIN_CHECK.ASP
<%
Dim usr_name,usr_email
// get values from MAIN_FORM.PHP
usr_name = Request.Form("gb_name"
usr_email = Request.Form("gb_email"
// display variable's value
response.write usr_name & "<br>"
response.write usr_email
%>