|
| |
|
|
BerylSmall
Posts: 33 Joined: 8/8/2005 Status: offline
|
get values from dynamic dropdown - 8/14/2005 16:15:34
This probably sounds dumb but I'm new to this. Okay, I have created two dynamic dropdowns inside of my DRW. (I'm making an e-commerce site that posts to a shopping cart). The code for the dropdowns are as follows: <% Response.Write "<p><strong>Color:</strong> <select name='Option' ID='Color' Size='1'>" Set rsSample = Server.CreateObject("ADODB.Recordset") rsSample.Open "Select Distinct Color from Query1 where Products.Style='" & FP_FieldVal(fp_rs,"Style") & "'", fp_conn While not rsSample.EOF Response.Write "<option>" & rsSample.Fields("Color") & "</option>" rsSample.MoveNext Wend rsSample.Close Response.Write "</select><br>" %> <% Response.Write "<p><strong>Size:</strong> <select name='Option' ID='Size' Size='1'>" Set rsSample = Server.CreateObject("ADODB.Recordset") rsSample.Open "Select Distinct Garment_Size from Query1 where Products.Style='" & FP_FieldVal(fp_rs,"Style") & "' ORDER BY Garment_Size ASC", fp_conn While not rsSample.EOF Response.Write "<option>" & rsSample.Fields("Garment_Size") & "</option>" rsSample.MoveNext Wend rsSample.Close Response.Write "</select><br>" %> The dropdowns work great. The problem is, I need to get the selected values appended to my hyperlink on my Add to cart button. I know how to get the DRW values using <%=FP_FieldVal(fp_rs,"Style")%>, but how do I refer to the selected options in each dropdown box?
|
|
|
|
BerylSmall
Posts: 33 Joined: 8/8/2005 Status: offline
|
RE: get values from dynamic dropdown - 8/14/2005 16:47:01
It's hardcoded as a link: <a href="http://ww9.aitsafe.com/cf/add.cfm?userid=B828873&product=<%=FP_FieldVal(fp_rs,"Description")%>&price=<%=FP_FieldVal(fp_rs,"Retail_Price")%>&qty=1"><img border="0" src="../images/ADDButton.gif"></a>
|
|
|
|
BerylSmall
Posts: 33 Joined: 8/8/2005 Status: offline
|
RE: get values from dynamic dropdown - 8/14/2005 17:09:48
I don't get it. Do I put the DRW inside a Form? And if so, then how would I refer to the fields in the DRW? And still...how would I refer to the selected values in the dropdown boxes?
|
|
|
|
BerylSmall
Posts: 33 Joined: 8/8/2005 Status: offline
|
RE: get values from dynamic dropdown - 8/14/2005 17:56:07
yes, that is correct.
|
|
|
|
BerylSmall
Posts: 33 Joined: 8/8/2005 Status: offline
|
RE: get values from dynamic dropdown - 8/14/2005 18:34:17
Okay, now you've really lost me.. You say inside the loops of the DRW...The only loops that I know of in the DRW are the loops that populate the dropdowns. I should put that code in there?
|
|
|
|
BerylSmall
Posts: 33 Joined: 8/8/2005 Status: offline
|
RE: get values from dynamic dropdown - 8/14/2005 18:37:31
I'm really confused now...Am I putting a form inside the DRW? When I do insert Form I get these submit buttons (that I don't need) and then what happens to my add to cart button? And I still don't see where I'm getting the values from my dropdowns (Size and Color) they are missing from the form code there. I don't get this at all...
< Message edited by BerylSmall -- 8/14/2005 18:44:16 >
|
|
|
|
BerylSmall
Posts: 33 Joined: 8/8/2005 Status: offline
|
RE: get values from dynamic dropdown - 8/14/2005 20:33:54
Yes, I can post the code, but the values from the dropdowns are not including because I don't know how to refer to them.
|
|
|
|
BerylSmall
Posts: 33 Joined: 8/8/2005 Status: offline
|
RE: get values from dynamic dropdown - 8/14/2005 21:21:27
quote:
<a href="http://ww9.aitsafe.com/cf/add.cfm?userid=B828873&product=<%=FP_FieldVal(fp_rs,"Description")%>&price=<%=FP_FieldVal(fp_rs,"Retail_Price")%>&qty=1"><img border="0" src="../images/ADDButton.gif"></a> and <form method=GET Action="http://ww9.aitsafe.com/cf/add.cfm"> <input type=hidden value="B828873" name="userid"> <input type=hidden value="<%=FP_FieldVal(fp_rs,"Description")%>" name="product"> <input type=hidden value="<%=FP_FieldVal(fp_rs,"Retail_Price")%>" name="price"> <input type=hidden value="1" name="qty"> <input type=submit> </form> Both work. But how do I get the dropdowns in either one?
|
|
|
|
BerylSmall
Posts: 33 Joined: 8/8/2005 Status: offline
|
RE: get values from dynamic dropdown - 8/14/2005 21:50:06
No, it does not belong to me and it doesn't take "Size". I have to concatenate it with the product. This is a sample that works (but of course it is not dynamic): <form action="http://www.aitsafe.com/cf/add.cfm" method="post">
<input type="hidden" name="userid" value="malc">
<input type="hidden" name="return" value="www.mals-e.com/help7.cfm">
<table width="100%" border="0" bgcolor="#f5f5f5">
<tr><td width="80%">
Musto Oceanmaster sailing jacket. <b>Price: $159.00</b><br>
Select your size :
<input type="hidden" name="product[]" value="Oceanmaster jacket">
<select name="product[]">
<option value="Small">Small</option>
<option value="Medium">Medium</option>
<option value="Large">Large</option>
<option value="X-Large">X-Large</option>
</select>
Color :
<select name="product[]">
<option value="Red">Red</option>
<option value="Navy">Navy</option>
<option value="Green">Green</option>
</select>
</td>
<td>
<input type="hidden" name="price" value="159">
<input type="submit" value="Buy Now!">
</td>
</tr>
</table>
</form>
< Message edited by Spooky -- 8/15/2005 1:27:36 >
|
|
|
|
BerylSmall
Posts: 33 Joined: 8/8/2005 Status: offline
|
RE: get values from dynamic dropdown - 8/14/2005 23:23:05
The options in the above "test" do not show in the cart either.
|
|
|
|
BerylSmall
Posts: 33 Joined: 8/8/2005 Status: offline
|
RE: get values from dynamic dropdown - 8/14/2005 23:52:34
Okay, I tried the following the "Size" is dynamic, but the "Color" is not. The Size does NOT show up in the cart, but the Color does.... <form action="http://ww9.aitsafe.com/cf/add.cfm" method="post">
<input type="hidden" name="userid" value="B828873">
<input type="hidden" name="return" value="http://localhost/Test2/test.asp">
<table width="100%" border="0" bgcolor="#f5f5f5">
<tr>
<td width="80%">
</b><br>
Select your size :
<input type="hidden" name="product[]" value="<%=FP_FieldVal(fp_rs,"Description")%>">
<select name="Product[]" Size='1'>
<%Set rsSample = Server.CreateObject("ADODB.Recordset")
rsSample.Open "Select Distinct Garment_Size from Query1 where Products.Style='" & FP_FieldVal(fp_rs,"Style") & "' ORDER BY Garment_Size ASC", fp_conn
While not rsSample.EOF
Response.Write "<option value=" & rsSample.Fields("Garment_Size") & ">" & rsSample.Fields("Garment_Size") & "</option>"
rsSample.MoveNext
Wend
rsSample.Close%>
</select><br>"
Color :
<select name="product[]">
<option value="Red">Red</option>
<option value="Navy">Navy</option>
<option value="Green">Green</option>
</select>
</td>
<td>
<input type="hidden" name="price" value="<%=FP_FieldVal(fp_rs,"Retail_Price")%>">
<input type="submit" value="Buy Now!">
</td>
</tr>
</table>
</form>
< Message edited by Spooky -- 8/15/2005 1:27:15 >
|
|
|
|
BerylSmall
Posts: 33 Joined: 8/8/2005 Status: offline
|
RE: get values from dynamic dropdown - 8/15/2005 0:10:45
Nope...Color, No Size
|
|
|
|
BerylSmall
Posts: 33 Joined: 8/8/2005 Status: offline
|
RE: get values from dynamic dropdown - 8/15/2005 0:45:21
Using the Hyperlink below, I can add the word 'Test' to the product description, and it shows up in the cart. I there a way for me to get value of the option into text so that I can just add it to the hyperlink? "http://ww9.aitsafe.com/cf/add.cfm?userid=B828873&product=<%=FP_FieldVal(fp_rs,"Description")%>+'Test'&price=<%=FP_FieldVal(fp_rs,"Retail_Price")%>"><img border="0" src="../images/ADDButton.gif"></a>
|
|
|
|
BerylSmall
Posts: 33 Joined: 8/8/2005 Status: offline
|
RE: get values from dynamic dropdown - 8/15/2005 0:46:23
Yes, if I use hard coded options, they work. Only the dynamic doesn't.
|
|
|
|
BerylSmall
Posts: 33 Joined: 8/8/2005 Status: offline
|
RE: get values from dynamic dropdown - 8/15/2005 1:06:58
<table width="898" border="1">
<thead>
<tr>
<td width="165"><b>Picture</b></td>
<td width="137"><b>Style</b></td>
<td width="66"><b>Color</b></td>
<td width="65"><b>Size</b></td>
<td width="225"> </td>
<td width="225"><b>Description</b></td>
<td width="132"><b>Retail_Price</b></td>
<td width="78">Add to Cart</td>
</tr>
</thead>
<tbody>
<!--webbot bot="DatabaseRegionStart" startspan
s-columnnames="Style,Description,Picture,Retail_Price"
s-columntypes="202,202,203,6" s-dataconnection="Products"
b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice s-menuvalue
b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE"
b-listlabels="TRUE" b-listseparator="TRUE" i-ListFormat="0"
b-makeform="TRUE" s-recordsource
s-displaycolumns="Picture,Style,Description,Retail_Price" s-criteria s-order
s-sql="SELECT Distinct Products.Style,Description,Picture,Retail_Price FROM Query1"
b-procedure="FALSE" clientside SuggestedExt="asp" s-DefaultFields
s-NoRecordsFound="No records returned." i-MaxRecords="256" i-GroupSize="5"
BOTID="0" u-dblib="../_fpclass/fpdblib.inc" u-dbrgn1="../_fpclass/fpdbrgn1.inc"
u-dbrgn2="../_fpclass/fpdbrgn2.inc" tag="TBODY"
local_preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left" width="100%"><font color="#000000">Database Results regions will not preview unless this page is fetched from a Web server with a web browser. The following table row will repeat once for every record returned by the query.</font></td></tr>"
preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left" width="100%"><font color="#000000">This is the start of a Database Results region.</font></td></tr>" --><!--#include file="../_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT Distinct Products.Style,Description,Picture,Retail_Price FROM Query1"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=4 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="Products"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=4
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" i-CheckSum="43172" endspan -->
<tr>
<td width="165"><a href="ProductPage.asp?Style=<%=FP_FieldURL(fp_rs,"Style")%>"><img border="0" src="<%=FP_FieldLink(fp_rs,"Picture")%>" width="250" height="250">
</a>
</td>
<td width="137"><!--webbot bot="DatabaseResultColumn" startspan
s-columnnames="Style,Description,Picture,Retail_Price" s-column="Style"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside
local_preview="<font size="-1"><<</font>Style<font size="-1">>></font>"
preview="<font size="-1"><<</font>Style<font size="-1">>></font>" --><%=FP_FieldVal(fp_rs,"Style")%><!--webbot
bot="DatabaseResultColumn" i-CheckSum="10122" endspan -->
</td>
<td width="66"><!--webbot bot="HTMLMarkup" startspan --><%
Response.Write "<p><strong>Color:</strong> <select name='Product' ID='Color' Size='1'>"
Set rsSample = Server.CreateObject("ADODB.Recordset")
rsSample.Open "Select Distinct Color from Query1 where Products.Style='" & FP_FieldVal(fp_rs,"Style") & "'", fp_conn
While not rsSample.EOF
Response.Write "<option>" & rsSample.Fields("Color") & "</option>"
rsSample.MoveNext
Wend
rsSample.Close
Response.Write "</select><br>"
%>
<!--webbot bot="HTMLMarkup" endspan -->
</td>
<td width="65"><!--webbot bot="HTMLMarkup" startspan --><%
Response.Write "<p><strong>Size:</strong> <select name='Product' ID='Size' Size='1'>"
Set rsSample = Server.CreateObject("ADODB.Recordset")
rsSample.Open "Select Distinct Garment_Size from Query1 where Products.Style='" & FP_FieldVal(fp_rs,"Style") & "' ORDER BY Garment_Size ASC", fp_conn
While not rsSample.EOF
Response.Write "<option>" & rsSample.Fields("Garment_Size") & "</option>"
rsSample.MoveNext
Wend
rsSample.Close
Response.Write "</select><br>"
%>
<!--webbot bot="HTMLMarkup" endspan -->
</td>
<td width="225"><!--webbot bot="HTMLMarkup" startspan -->
<a href="http://ww9.aitsafe.com/cf/add.cfm?userid=B828873&product=<%=FP_FieldVal(fp_rs,"Description")%>+'Test'&price=<%=FP_FieldVal(fp_rs,"Retail_Price")%>"><img border="0" src="../images/ADDButton.gif"></a>
<!--webbot
bot="HTMLMarkup" endspan -->
</td>
<td width="225"><!--webbot bot="DatabaseResultColumn" startspan
s-columnnames="Style,Description,Picture,Retail_Price"
s-column="Description" b-tableformat="TRUE" b-hasHTML="FALSE" clientside
local_preview="<font size="-1"><<</font>Description<font size="-1">>></font>"
preview="<font size="-1"><<</font>Description<font size="-1">>></font>" --><%=FP_FieldVal(fp_rs,"Description")%><!--webbot
bot="DatabaseResultColumn" i-CheckSum="30092" endspan -->
</td>
<td width="132"><!--webbot bot="DatabaseResultColumn" startspan
s-columnnames="Style,Description,Picture,Retail_Price"
s-column="Retail_Price" b-tableformat="TRUE" b-hasHTML="FALSE"
clientside
local_preview="<font size="-1"><<</font>Retail_Price<font size="-1">>></font>"
preview="<font size="-1"><<</font>Retail_Price<font size="-1">>></font>" --><%=FP_FieldVal(fp_rs,"Retail_Price")%><!--webbot
bot="DatabaseResultColumn" i-CheckSum="31068" endspan -->
</td>
<td width="78"><form action="http://ww9.aitsafe.com/cf/add.cfm" method="post">
<input type="hidden" name="userid" value="B828873">
<input type="hidden" name="return" value="http://localhost/Test2/applebottoms.asp">
<table width="100%" border="0" bgcolor="#f5f5f5">
<tr>
<td width="80%">
Select your size :
<input type="hidden" name="product[]" value="<%=FP_FieldVal(fp_rs,"Description")%>">
<select name="Product[]" Size='1'>
<%Set rsSample = Server.CreateObject("ADODB.Recordset")
rsSample.Open "Select Distinct Garment_Size from Query1 where Products.Style='" & FP_FieldVal(fp_rs,"Style") & "' ORDER BY Garment_Size ASC", fp_conn
While not rsSample.EOF
Response.Write "<option value=" & rsSample.Fields("Garment_Size") & ">" & rsSample.Fields("Garment_Size") & "</option>"
rsSample.MoveNext
Wend
rsSample.Close%>
</select><br>
Color :
<select name="product[]">
<option value="Red">Red</option>
<option value="Navy">Navy</option>
<option value="Green">Green</option>
</select>
</td>
<td>
<input type="hidden" name="price" value="<%=FP_FieldVal(fp_rs,"Retail_Price")%>">
<input type="submit" value="Buy Now!">
</td>
</tr>
</table>
</form> </td>
</tr>
<!--webbot bot="DatabaseRegionEnd" startspan b-tableformat="TRUE"
b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdbrgn2.inc" i-groupsize="5"
clientside tag="TBODY"
local_preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left" width="100%"><font color="#000000">This is the end of a Database Results region.</font></td></tr><TR><TD ALIGN=LEFT VALIGN=MIDDLE COLSPAN=64><FORM><NOBR><INPUT TYPE=Button VALUE=" |< "><INPUT TYPE=Button VALUE=" < "><INPUT TYPE=Button VALUE=" > "><INPUT TYPE=Button VALUE=" >| "> [1/5]</NOBR></FORM></td></tr>"
preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left" width="100%"><font color="#000000">This is the end of a Database Results region.</font></td></tr><TR><TD ALIGN=LEFT VALIGN=MIDDLE COLSPAN=64><NOBR><INPUT TYPE=Button VALUE=" |< "><INPUT TYPE=Button VALUE=" < "><INPUT TYPE=Button VALUE=" > "><INPUT TYPE=Button VALUE=" >| "> [1/5]</NOBR><BR></td></tr>" --><!--#include file="../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" i-CheckSum="56926" endspan -->
</tbody>
</table>
</body>
< Message edited by Spooky -- 8/15/2005 1:26:22 >
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|