[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.9

What's wrong with this id field?

Asked by brucegust in Active Server Pages (ASP)

Tags: ASP VBScript SQL

Head out to http://asapawards.net/Store/HYSA.asp. When you click on any of the "medals," you get a pop up that has a picture of the item - at least that's what's supposed to happen. It works with the trophies without any problem, but with the medals, somehow I'm passing an incorrect product id into the JavaScript, but I don't see how.

My code is attached. You can see the correct product id when you hover your mouse over the "Add to Cart" button. Then, when you click on the product title itself, you'll get the pop up window and I have the product id written at the top (I did that to help troubleshoot the problem). With the trophies, it's the correct product id, but with every one of the medals, it's incorrect.

What am I missing?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
<%@ Language=VBScript %>
 
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>ASAP Online Showroom Page</title>
<link rel="stylesheet" type="text/css" href="style.css"> 
</head>
 
<BODY  LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 bgcolor="#ffffff">
 
<table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center">&nbsp;<BR>
	<table width="800" border="0" cellspacing="0" cellpadding="0">
	<tr>
	<td valign="top" align="center" valign="top" bgcolor="#FEF8E8">
		<table width=800 cellpadding="0" cellspacing="0" border="0" align="center">
		<tr>
		<td align="center" colspan="3">
		<A HREF="../default.htm"><IMG SRC="images/Header.jpg" border="0">
		</td>
		</tr>
		<tr>
		<td>
		<IMG SRC="images/spacer.gif" width="10" height="10">
		</td>
		<td>&nbsp;<BR>&nbsp;<BR>
		Welcome to the ASAP Awards Online Shopping Center prepared exclusively for HYSA. Here you'll find a large sampling of what ASAP has to offer in the way of quality awards you'll be proud to present.
		<P>
		Know that while you'll find a great collection here online, our showroom and staff can help you locate anything that you might need beyond what's listed here. Should you
		need any assistance, please give us a call at 931.451.7195.
		<P>
		To view a photo and a catalog description, click on the product name. To add the item to your cart and proceed to checkout, click on "Add To Cart."
		<P>
		Thanks!
		<P>
		<div align="center"><b>Each item has been discounted expressly for HYSA! Also, be sure to use the promo code "HYSA" when you're getting ready to check out! By using that code you'll be given free shipping!"</b></div>
		&nbsp;<BR>&nbsp;<BR>
		</td>
		<td>
		<IMG SRC="images/spacer.gif" width="10" height="10">
		</td>
		</tr>
		</table>
	</td>
	</tr>
	<tr>
	<td align="center" bgcolor="#FEF8E8">
		<table border="1" width="700">
		<tr>
		<td align="center" bgcolor="#6E6F6F">
		<font color="white">Name</font>
		</td>
		<td align="center" bgcolor="#6E6F6F">
		<font color="white">Price</font>
		</td>
		<td align="center" bgcolor="#6E6F6F">
		<font color="white">Quantity</font>
		</td>
		</tr>			
		<tr>
		<td colspan="3" bgcolor="#961B0C">
		<font color="white">Medals</font>
		</td>
		</tr>
		<%
		set DBConn = Server.CreateObject("ADODB.Connection")
		DBConn.Open session("dbConn_ConnectionString")
		set rsMedals= Server.CreateObject("ADODB.Recordset")
		sql4 = "select * from HYSA where ProductCategory='Medals' order by ProductType"
		rsMedals.open sql4,dbconn,3,3
 
		idm = 1
		if(not rsMedals.EOF) then
			idm = 1
			While not rsMedals.EOF
			%>
			<SCRIPT LANGUAGE="JavaScript">
			function Explosion<%=idm%>() {
			 var newWindow = open("Description.asp?ID=<%=RSMedals("ID") %>", "secondWindow", "scrollbars=1, width=500,height=300");
			}
			</SCRIPT>
			<%
				a = "<tr><td valign=""center""> " _ 
				& "<a href=""#"" title=""Sixty Days"" onclick=""Explosion" 
				b = idm
				c = "();return false"">"
				d = LTrim(RTrim(RSMedals("ProductName")))
				e = "</a></td><td align=""center"">"
				f = FormatCurrency(RSMedals("Price"),2)
				g = "</a></td><td align=""center""><A HREF=""ShoppingCart.asp?ProductID="
				h = RSMedals("ID")
				j = "&ProductCategory="
				k = RSMedals("ProductCategory")
				l = """><IMG SRC=""Images/AddToCart.jpg"" border=""0""></a>"
				m = "</td></tr>"
				response.write a&b&c&d&e&f&g&h&j&k&l&m
				idm = idm + 1
				rsMedals.MoveNext
			Wend
		end if
		%>
				
					
		<tr>
		<td colspan="3" bgcolor="#961B0C">
		<font color="white">Trophies</font>
		</td>
		</tr>
		<%
		set rsTrophies= Server.CreateObject("ADODB.Recordset")
		sql4 = "select * from HYSA where ProductCategory='Trophies' order by ProductType"
		rsTrophies.open sql4,dbconn,3,3
 
		idt = 1
		if(not rsTrophies.EOF) then
			idt = 1
			While not rsTrophies.EOF
			%>
			<SCRIPT LANGUAGE="JavaScript">
			function Explosion<%=idt%>() {
			 var newWindow = open("Description.asp?ID=<%=RSTrophies("ID") %>", "secondWindow", "scrollbars=1, width=500,height=300");
			}
			</SCRIPT>
			<%
				a = "<tr><td valign=""center""> " _ 
				& "<a href=""#"" title=""Sixty Days"" onclick=""Explosion" 
				b = idt
				c = "();return false"">"
				d = LTrim(RTrim(RSTrophies("ProductName")))
				e = "</a></td><td align=""center"">"
				f = FormatCurrency(RSTrophies("Price"),2)
				g = "</a></td><td align=""center""><A HREF=""ShoppingCartTrophies.asp?ProductID="
				h = RSTrophies("ID")
				j = "&ProductCategory="
				k = RSTrophies("ProductCategory")
				l = """><IMG SRC=""Images/AddToCart.jpg"" border=""0""></a>"
				m = "</td></tr>"
				response.write a&b&c&d&e&f&g&h&j&k&l&m
				idt = idt + 1
				rsTrophies.MoveNext
			Wend
		end if
		%>
		</table>
	</td>
	</tr>
	<tr>
	<td bgcolor="#FEF8E8">
	<A HREF="http://www.rimshotwebdesign.com" target="_blank"><IMG SRC="Images/Footer.jpg" border="0"></a>
	</td>
	</tr>	
	</table>
</td>
</tr>
</table>
 
<%
set conn=nothing
%>
 
</body>
</html>	
[+][-]11/03/09 07:33 AM, ID: 25729892Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Active Server Pages (ASP)
Tags: ASP VBScript SQL
Sign Up Now!
Solution Provided By: sybe
Participating Experts: 2
Solution Grade: A
 
[+][-]11/03/09 07:41 AM, ID: 25730003Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]11/04/09 08:31 AM, ID: 25741015Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20080625