ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 3rd, 2009, 04:05 PM
cecilia cecilia is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 35 cecilia User rank is Corporal (100 - 500 Reputation Level)cecilia User rank is Corporal (100 - 500 Reputation Level)cecilia User rank is Corporal (100 - 500 Reputation Level)cecilia User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 23 h 2 m 48 sec
Reputation Power: 2
If possible, then please re-write my code. Thanks!

Hi everyone,

My code (below) is too long if I have 100 shipping options.

If possible, then please re-write my code.

Thanks,

Cecilia


Code:
<FORM id=form3 name=form1>
Shipping Method: <SELECT NAME="lanuages" onchange='location.href="ShoppingCart.asp?Display=true&ShippingCost="+this.form.lanuages.options[this.form.lanuages.selectedIndex].value + "&CreditCart=" + <%= Request("CreditCart") %>+ "&Category_02_Id=" + <%= Request("Category_02_Id") %>+"&Category_03_Id=" + <%= Request("Category_03_Id") %>+"&Category_04_Id=" + <%= Request("Category_04_Id") %>;'>

<%

If Request("ShippingCost") = 1 Then

Response.Write "<option SELECTED value=""" & 1 & """>Ground (Continental U.S. Only) - UPS FREE</option>" & _
"<option value=""" & 15.95 & """>Guam, American Samoa - U.S. Postal $15.95</option>" & _
"<option value=""" & 15.96 & """>U.S. Virgin Islands - U.S. Postal $15.96</option>" & _
"<option value=""" & 8.95 & """>Hawaii, Alaska, Puerto Rico - U.S. Postal $8.95</option>" & _
"<option value=""" & 25.95 & """>Hawaii, Alaska, Puerto Rico - UPS $25.95</option>" & _
"<option value=""" & 20.95 & """>Canada, Mexico - U.S. Postal - $20.95</option>" & _
"<option value=""" & 59.95 & """>Canada, Mexico - UPS - $59.95</option>" & _
"<option value=""" & 25.96 & """>International (1-5 pair) - U.S. Postal $25.96</option>" & _
"<option value=""" & 49.95 & """>International (6-10 pair) - U.S. Postal $49.95</option>" & _
"<option value=""" & 159.95 & """>International (over 10 pair) - U.S. Postal $159.95 </option>" & _
"<option value=""" & 2 & """>PO BOX/ APO - U.S. Postal only - FREE</option>"

End If


If Request("ShippingCost") = 15.95 Then

Response.Write "<option value=""" & 1 & """>Ground (Continental U.S. Only) - UPS FREE</option>" & _
"<option SELECTED value=""" & 15.95 & """>Guam, American Samoa - U.S. Postal $15.95</option>" & _
"<option value=""" & 15.96 & """>U.S. Virgin Islands - U.S. Postal $15.96</option>" & _
"<option value=""" & 8.95 & """>Hawaii, Alaska, Puerto Rico - U.S. Postal $8.95</option>" & _
"<option value=""" & 25.95 & """>Hawaii, Alaska, Puerto Rico - UPS $25.95</option>" & _
"<option value=""" & 20.95 & """>Canada, Mexico - U.S. Postal - $20.95</option>" & _
"<option value=""" & 59.95 & """>Canada, Mexico - UPS - $59.95</option>" & _
"<option value=""" & 25.96 & """>International (1-5 pair) - U.S. Postal $25.96</option>" & _
"<option value=""" & 49.95 & """>International (6-10 pair) - U.S. Postal $49.95</option>" & _
"<option value=""" & 159.95 & """>International (over 10 pair) - U.S. Postal $159.95 </option>" & _
"<option value=""" & 2 & """>PO BOX/ APO - U.S. Postal only - FREE</option>"

End If

If Request("ShippingCost") = 15.96 Then

Response.Write "<option value=""" & 1 & """>Ground (Continental U.S. Only) - UPS FREE</option>" & _
"<option value=""" & 15.95 & """>Guam, American Samoa - U.S. Postal $15.95</option>" & _
"<option SELECTED value=""" & 15.96 & """>U.S. Virgin Islands - U.S. Postal $15.96</option>" & _
"<option value=""" & 8.95 & """>Hawaii, Alaska, Puerto Rico - U.S. Postal $8.95</option>" & _
"<option value=""" & 25.95 & """>Hawaii, Alaska, Puerto Rico - UPS $25.95</option>" & _
"<option value=""" & 20.95 & """>Canada, Mexico - U.S. Postal - $20.95</option>" & _
"<option value=""" & 59.95 & """>Canada, Mexico - UPS - $59.95</option>" & _
"<option value=""" & 25.96 & """>International (1-5 pair) - U.S. Postal $25.96</option>" & _
"<option value=""" & 49.95 & """>International (6-10 pair) - U.S. Postal $49.95</option>" & _
"<option value=""" & 159.95 & """>International (over 10 pair) - U.S. Postal $159.95 </option>" & _
"<option value=""" & 2 & """>PO BOX/ APO - U.S. Postal only - FREE</option>"

End If

If Request("ShippingCost") = 8.95 Then

Response.Write "<option value=""" & 1 & """>Ground (Continental U.S. Only) - UPS FREE</option>" & _
"<option value=""" & 15.95 & """>Guam, American Samoa - U.S. Postal $15.95</option>" & _
"<option value=""" & 15.96 & """>U.S. Virgin Islands - U.S. Postal $15.96</option>" & _
"<option SELECTED value=""" & 8.95 & """>Hawaii, Alaska, Puerto Rico - U.S. Postal $8.95</option>" & _
"<option value=""" & 25.95 & """>Hawaii, Alaska, Puerto Rico - UPS $25.95</option>" & _
"<option value=""" & 20.95 & """>Canada, Mexico - U.S. Postal - $20.95</option>" & _
"<option value=""" & 59.95 & """>Canada, Mexico - UPS - $59.95</option>" & _
"<option value=""" & 25.96 & """>International (1-5 pair) - U.S. Postal $25.96</option>" & _
"<option value=""" & 49.95 & """>International (6-10 pair) - U.S. Postal $49.95</option>" & _
"<option value=""" & 159.95 & """>International (over 10 pair) - U.S. Postal $159.95 </option>" & _
"<option value=""" & 2 & """>PO BOX/ APO - U.S. Postal only - FREE</option>"

End If

If Request("ShippingCost") = 25.95 Then

Response.Write "<option value=""" & 1 & """>Ground (Continental U.S. Only) - UPS FREE</option>" & _
"<option value=""" & 15.95 & """>Guam, American Samoa - U.S. Postal $15.95</option>" & _
"<option value=""" & 15.96 & """>U.S. Virgin Islands - U.S. Postal $15.96</option>" & _
"<option value=""" & 8.95 & """>Hawaii, Alaska, Puerto Rico - U.S. Postal $8.95</option>" & _
"<option SELECTED value=""" & 25.95 & """>Hawaii, Alaska, Puerto Rico - UPS $25.95</option>" & _
"<option value=""" & 20.95 & """>Canada, Mexico - U.S. Postal - $20.95</option>" & _
"<option value=""" & 59.95 & """>Canada, Mexico - UPS - $59.95</option>" & _
"<option value=""" & 25.96 & """>International (1-5 pair) - U.S. Postal $25.96</option>" & _
"<option value=""" & 49.95 & """>International (6-10 pair) - U.S. Postal $49.95</option>" & _
"<option value=""" & 159.95 & """>International (over 10 pair) - U.S. Postal $159.95 </option>" & _
"<option value=""" & 2 & """>PO BOX/ APO - U.S. Postal only - FREE</option>"

End If

If Request("ShippingCost") = 20.95 Then

Response.Write "<option value=""" & 1 & """>Ground (Continental U.S. Only) - UPS FREE</option>" & _
"<option value=""" & 15.95 & """>Guam, American Samoa - U.S. Postal $15.95</option>" & _
"<option value=""" & 15.96 & """>U.S. Virgin Islands - U.S. Postal $15.96</option>" & _
"<option value=""" & 8.95 & """>Hawaii, Alaska, Puerto Rico - U.S. Postal $8.95</option>" & _
"<option value=""" & 25.95 & """>Hawaii, Alaska, Puerto Rico - UPS $25.95</option>" & _
"<option SELECTED value=""" & 20.95 & """>Canada, Mexico - U.S. Postal - $20.95</option>" & _
"<option value=""" & 59.95 & """>Canada, Mexico - UPS - $59.95</option>" & _
"<option value=""" & 25.96 & """>International (1-5 pair) - U.S. Postal $25.96</option>" & _
"<option value=""" & 49.95 & """>International (6-10 pair) - U.S. Postal $49.95</option>" & _
"<option value=""" & 159.95 & """>International (over 10 pair) - U.S. Postal $159.95 </option>" & _
"<option value=""" & 2 & """>PO BOX/ APO - U.S. Postal only - FREE</option>"

End If

If Request("ShippingCost") = 59.95 Then

Response.Write "<option value=""" & 1 & """>Ground (Continental U.S. Only) - UPS FREE</option>" & _
"<option value=""" & 15.95 & """>Guam, American Samoa - U.S. Postal $15.95</option>" & _
"<option value=""" & 15.96 & """>U.S. Virgin Islands - U.S. Postal $15.96</option>" & _
"<option value=""" & 8.95 & """>Hawaii, Alaska, Puerto Rico - U.S. Postal $8.95</option>" & _
"<option value=""" & 25.95 & """>Hawaii, Alaska, Puerto Rico - UPS $25.95</option>" & _
"<option value=""" & 20.95 & """>Canada, Mexico - U.S. Postal - $20.95</option>" & _
"<option SELECTED value=""" & 59.95 & """>Canada, Mexico - UPS - $59.95</option>" & _
"<option value=""" & 25.96 & """>International (1-5 pair) - U.S. Postal $25.96</option>" & _
"<option value=""" & 49.95 & """>International (6-10 pair) - U.S. Postal $49.95</option>" & _
"<option value=""" & 159.95 & """>International (over 10 pair) - U.S. Postal $159.95 </option>" & _
"<option value=""" & 2 & """>PO BOX/ APO - U.S. Postal only - FREE</option>"

End If

If Request("ShippingCost") = 25.96 Then

Response.Write "<option value=""" & 1 & """>Ground (Continental U.S. Only) - UPS FREE</option>" & _
"<option value=""" & 15.95 & """>Guam, American Samoa - U.S. Postal $15.95</option>" & _
"<option value=""" & 15.96 & """>U.S. Virgin Islands - U.S. Postal $15.96</option>" & _
"<option value=""" & 8.95 & """>Hawaii, Alaska, Puerto Rico - U.S. Postal $8.95</option>" & _
"<option value=""" & 25.95 & """>Hawaii, Alaska, Puerto Rico - UPS $25.95</option>" & _
"<option value=""" & 20.95 & """>Canada, Mexico - U.S. Postal - $20.95</option>" & _
"<option value=""" & 59.95 & """>Canada, Mexico - UPS - $59.95</option>" & _
"<option SELECTED value=""" & 25.96 & """>International (1-5 pair) - U.S. Postal $25.96</option>" & _
"<option value=""" & 49.95 & """>International (6-10 pair) - U.S. Postal $49.95</option>" & _
"<option value=""" & 159.95 & """>International (over 10 pair) - U.S. Postal $159.95 </option>" & _
"<option value=""" & 2 & """>PO BOX/ APO - U.S. Postal only - FREE</option>"

End If

If Request("ShippingCost") = 49.95 Then

Response.Write "<option value=""" & 1 & """>Ground (Continental U.S. Only) - UPS FREE</option>" & _
"<option value=""" & 15.95 & """>Guam, American Samoa - U.S. Postal $15.95</option>" & _
"<option value=""" & 15.96 & """>U.S. Virgin Islands - U.S. Postal $15.96</option>" & _
"<option value=""" & 8.95 & """>Hawaii, Alaska, Puerto Rico - U.S. Postal $8.95</option>" & _
"<option value=""" & 25.95 & """>Hawaii, Alaska, Puerto Rico - UPS $25.95</option>" & _
"<option value=""" & 20.95 & """>Canada, Mexico - U.S. Postal - $20.95</option>" & _
"<option value=""" & 59.95 & """>Canada, Mexico - UPS - $59.95</option>" & _
"<option value=""" & 25.96 & """>International (1-5 pair) - U.S. Postal $25.96</option>" & _
"<option SELECTED value=""" & 49.95 & """>International (6-10 pair) - U.S. Postal $49.95</option>" & _
"<option value=""" & 159.95 & """>International (over 10 pair) - U.S. Postal $159.95 </option>" & _
"<option value=""" & 2 & """>PO BOX/ APO - U.S. Postal only - FREE</option>"

End If

If Request("ShippingCost") = 159.95 Then

Response.Write "<option value=""" & 1 & """>Ground (Continental U.S. Only) - UPS FREE</option>" & _
"<option value=""" & 15.95 & """>Guam, American Samoa - U.S. Postal $15.95</option>" & _
"<option value=""" & 15.96 & """>U.S. Virgin Islands - U.S. Postal $15.96</option>" & _
"<option value=""" & 8.95 & """>Hawaii, Alaska, Puerto Rico - U.S. Postal $8.95</option>" & _
"<option value=""" & 25.95 & """>Hawaii, Alaska, Puerto Rico - UPS $25.95</option>" & _
"<option value=""" & 20.95 & """>Canada, Mexico - U.S. Postal - $20.95</option>" & _
"<option value=""" & 59.95 & """>Canada, Mexico - UPS - $59.95</option>" & _
"<option value=""" & 25.96 & """>International (1-5 pair) - U.S. Postal $25.96</option>" & _
"<option value=""" & 49.95 & """>International (6-10 pair) - U.S. Postal $49.95</option>" & _
"<option SELECTED value=""" & 159.95 & """>International (over 10 pair) - U.S. Postal $159.95 </option>" & _
"<option value=""" & 2 & """>PO BOX/ APO - U.S. Postal only - FREE</option>"

End If

If Request("ShippingCost") = 2 Then

Response.Write "<option value=""" & 1 & """>Ground (Continental U.S. Only) - UPS FREE</option>" & _
"<option value=""" & 15.95 & """>Guam, American Samoa - U.S. Postal $15.95</option>" & _
"<option value=""" & 15.96 & """>U.S. Virgin Islands - U.S. Postal $15.96</option>" & _
"<option value=""" & 8.95 & """>Hawaii, Alaska, Puerto Rico - U.S. Postal $8.95</option>" & _
"<option value=""" & 25.95 & """>Hawaii, Alaska, Puerto Rico - UPS $25.95</option>" & _
"<option value=""" & 20.95 & """>Canada, Mexico - U.S. Postal - $20.95</option>" & _
"<option value=""" & 59.95 & """>Canada, Mexico - UPS - $59.95</option>" & _
"<option value=""" & 25.96 & """>International (1-5 pair) - U.S. Postal $25.96</option>" & _
"<option value=""" & 49.95 & """>International (6-10 pair) - U.S. Postal $49.95</option>" & _
"<option value=""" & 159.95 & """>International (over 10 pair) - U.S. Postal $159.95 </option>" & _
"<option SELECTED value=""" & 2 & """>PO BOX/ APO - U.S. Postal only - FREE</option>"

End If


%>

</SELECT>
</FORM>

Reply With Quote
  #2  
Old July 6th, 2009, 03:43 AM
Yeruhn's Avatar
Yeruhn Yeruhn is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Netherlands
Posts: 500 Yeruhn User rank is First Lieutenant (10000 - 20000 Reputation Level)Yeruhn User rank is First Lieutenant (10000 - 20000 Reputation Level)Yeruhn User rank is First Lieutenant (10000 - 20000 Reputation Level)Yeruhn User rank is First Lieutenant (10000 - 20000 Reputation Level)Yeruhn User rank is First Lieutenant (10000 - 20000 Reputation Level)Yeruhn User rank is First Lieutenant (10000 - 20000 Reputation Level)Yeruhn User rank is First Lieutenant (10000 - 20000 Reputation Level)Yeruhn User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Days 14 h 13 m 18 sec
Reputation Power: 127
This'll do the trick

Code:
Response.Write "<option "
If Request("ShippingCost") = 1 Then response.write "selected"
response.write " value=""" & 1 & """>Ground (Continental U.S. Only) - UPS FREE</option>" 

response.write "<option "
If Request("ShippingCost") = 15.95 Then response.write "selected"
response.write " value=""" & 15.95 & """>Guam, American Samoa - U.S. Postal $15.95</option>" 

etc...

Reply With Quote
  #3  
Old July 6th, 2009, 04:03 AM
cecilia cecilia is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 35 cecilia User rank is Corporal (100 - 500 Reputation Level)cecilia User rank is Corporal (100 - 500 Reputation Level)cecilia User rank is Corporal (100 - 500 Reputation Level)cecilia User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 23 h 2 m 48 sec
Reputation Power: 2
Quote:
Originally Posted by Yeruhn
This'll do the trick

Code:
Response.Write "<option "
If Request("ShippingCost") = 1 Then response.write "selected"
response.write " value=""" & 1 & """>Ground (Continental U.S. Only) - UPS FREE</option>" 

response.write "<option "
If Request("ShippingCost") = 15.95 Then response.write "selected"
response.write " value=""" & 15.95 & """>Guam, American Samoa - U.S. Postal $15.95</option>" 

etc...


Hi Yeruhn,

Thanks for your help!

The code you give me only display the selected item in the dropdownlist.

I need to display both the selected item and all other not selected items in the dropdownlist.

Thanks,

Cecilia

Reply With Quote
  #4  
Old July 6th, 2009, 05:49 AM
mystic7's Avatar
mystic7 mystic7 is offline
Contributing User
Click here for more information.
 
Join Date: Sep 2006
Posts: 1,480 mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 11 h 7 m 17 sec
Reputation Power: 270
Code:
<FORM id=form3 name=form1>
Shipping Method: <SELECT NAME="lanuages" onchange='location.href="ShoppingCart.asp?Display=true&ShippingCost="+this.form.lanuages.options[this.form.lanuages.selectedIndex].value + "&CreditCart=" + <%= Request("CreditCart") %>+ "&Category_02_Id=" + <%= Request("Category_02_Id") %>+"&Category_03_Id=" + <%= Request("Category_03_Id") %>+"&Category_04_Id=" + <%= Request("Category_04_Id") %>;'>


<%
If Request("ShippingCost") = 1 Then
Response.Write "<option SELECTED value=""" & 1 & """>Ground (Continental U.S. Only) - UPS FREE</option>" 
Else
Response.Write "<option value=""" & 1 & """>Ground (Continental U.S. Only) - UPS FREE</option>"
End If
If Request("ShippingCost") = 15.95 Then
Response.Write "<option SELECTED value=""" & 15.95 & """>Guam, American Samoa - U.S. Postal $15.95</option>" 
Else
Response.Write "<option value=""" & 15.95 & """>Guam, American Samoa - U.S. Postal $15.95</option>"
End If
If Request("ShippingCost") = 15.96 Then
Response.Write "<option SELECTED value=""" & 15.96 & """>U.S. Virgin Islands - U.S. Postal $15.96</option>" 
Else
Response.Write "<option value=""" & 15.96 & """>U.S. Virgin Islands - U.S. Postal $15.96</option>"
End If
If Request("ShippingCost") = 8.95 Then
Response.Write "<option SELECTED value=""" & 8.95 & """>Hawaii, Alaska, Puerto Rico - U.S. Postal $8.95</option>" 
Else
Response.Write "<option value=""" & 8.95 & """>Hawaii, Alaska, Puerto Rico - U.S. Postal $8.95</option>"
End If
If Request("ShippingCost") = 25.95 Then
Response.Write "<option SELECTED value=""" & 25.95 & """>Hawaii, Alaska, Puerto Rico - UPS $25.95</option>" 
Else
Response.Write "<option value=""" & 25.95 & """>Hawaii, Alaska, Puerto Rico - UPS $25.95</option>"
End If
If Request("ShippingCost") = 20.95 Then
Response.Write "<option SELECTED value=""" & 20.95 & """>Canada, Mexico - U.S. Postal - $20.95</option>" 
Else
Response.Write "<option value=""" & 20.95 & """>Canada, Mexico - U.S. Postal - $20.95</option>" 
End If
If Request("ShippingCost") = 59.95 Then
Response.Write "<option SELECTED value=""" & 59.95 & """>Canada, Mexico - UPS - $59.95</option>" 
Else
Response.Write "<option value=""" & 59.95 & """>Canada, Mexico - UPS - $59.95</option>"
End If
If Request("ShippingCost") = 25.96 Then
Response.Write "<option SELECTED value=""" & 25.96 & """>International (1-5 pair) - U.S. Postal $25.96</option>" 
Else
Response.Write "<option value=""" & 25.96 & """>International (1-5 pair) - U.S. Postal $25.96</option>" 
End If
If Request("ShippingCost") = 49.95 Then
Response.Write "<option SELECTED value=""" & 49.95 & """>International (6-10 pair) - U.S. Postal $49.95</option>" 
Else
Response.Write "<option value=""" & 49.95 & """>International (6-10 pair) - U.S. Postal $49.95</option>" 
End If
If Request("ShippingCost") = 159.95 Then
Response.Write "<option SELECTED value=""" & 159.95 & """>International (over 10 pair) - U.S. Postal $159.95 </option>" 
Else
Response.Write "<option value=""" & 159.95 & """>International (over 10 pair) - U.S. Postal $159.95 </option>" 
End If
If Request("ShippingCost") = 2 Then
Response.Write "<option SELECTED value=""" & 2 & """>PO BOX/ APO - U.S. Postal only - FREE</option>"
Else
Response.Write "<option value=""" & 2 & """>PO BOX/ APO - U.S. Postal only - FREE</option>"
End If
%>
</SELECT>
</FORM>

Reply With Quote
  #5  
Old July 6th, 2009, 06:08 AM
Guddu's Avatar
Guddu Guddu is offline
Contributing User
ASP Free Expert (3500 - 3999 posts)
 
Join Date: Jul 2005
Location: Oxford UK
Posts: 3,891 Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 5 Days 21 h 15 m 25 sec
Reputation Power: 984
Just completed Yeruhn's code.
Code:
<FORM id=form3 name=form1>
Shipping Method: <SELECT NAME="lanuages" onchange='location.href="ShoppingCart.asp?Display=true&ShippingCost="+this.form.lanuages.options[this.form.lanuages.selectedIndex].value + "&CreditCart=" + <%= Request("CreditCart") %>+ "&Category_02_Id=" + <%= Request("Category_02_Id") %>+"&Category_03_Id=" + <%= Request("Category_03_Id") %>+"&Category_04_Id=" + <%= Request("Category_04_Id") %>;'>

<%

Response.Write "<option "
If Request("ShippingCost") = 1 Then response.write "selected"
response.write " value=""" & 1 & """>Ground (Continental U.S. Only) - UPS FREE</option>" 

response.write "<option "
If Request("ShippingCost") = 15.95 Then response.write "selected"
response.write " value=""" & 15.95 & """>Guam, American Samoa - U.S. Postal $15.95</option>" 

Response.Write "<option "
If Request("ShippingCost") = 15.96 Then response.write "selected"
response.write " value=""" & 15.96 & """>U.S. Virgin Islands - U.S. Postal $15.96</option>" 

Response.Write "<option "
If Request("ShippingCost") = 8.95 Then response.write "selected"
response.write " value=""" & 8.95 & """>Hawaii, Alaska, Puerto Rico - U.S. Postal $8.95</option>" 

response.write "<option "
If Request("ShippingCost") = 25.95 Then response.write "selected"
response.write " value=""" & 25.95 & """>Hawaii, Alaska, Puerto Rico - UPS $25.95</option>" 

response.write "<option "
If Request("ShippingCost") = 20.95 Then response.write "selected"
response.write " value=""" & 20.95 & """>Canada, Mexico - U.S. Postal - $20.95</option>" 

response.write "<option "
If Request("ShippingCost") = 59.95 Then response.write "selected"
response.write " value=""" & 59.95 & """>Canada, Mexico - UPS - $59.95</option>" 

response.write "<option "
If Request("ShippingCost") = 25.96 Then response.write "selected"
response.write " value=""" & 25.96 & """>International (1-5 pair) - U.S. Postal $25.96</option>" 

response.write "<option "
If Request("ShippingCost") = 49.95 Then response.write "selected"
response.write " value=""" & 49.95 & """>International (6-10 pair) - U.S. Postal $49.95</option>" 

response.write "<option "
If Request("ShippingCost") = 159.95 Then response.write "selected"
response.write " value=""" & 159.95 & """>International (over 10 pair) - U.S. Postal $159.95</option>" 

response.write "<option "
If Request("ShippingCost") = 2 Then response.write "selected"
response.write " value=""" & 2 & """>PO BOX/ APO - U.S. Postal only - FREE</option>" 








%>

</SELECT>
</FORM>
__________________
Nothing is Impossible bcoz IMPOSSIBLE itself says..
I M POSSIBLE........................
Be cool !!!!!!!!

Reply With Quote
  #6  
Old July 6th, 2009, 07:58 AM
mystic7's Avatar
mystic7 mystic7 is offline
Contributing User
Click here for more information.
 
Join Date: Sep 2006
Posts: 1,480 mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 11 h 7 m 17 sec
Reputation Power: 270
Both of our methods work. Just choose whichever one looks neater

Couple of question, Guddu. I thought it was incorrect syntax to have an action, like response.write, on the same line as the if/then statement. Is it acceptable?

Second, how come all those if/then statements don't require an End If?

I tried out your code just out of curiosity and it works perfectly. Just wondering how you've "defied the laws of ASP", as it were

Last edited by mystic7 : July 6th, 2009 at 08:02 AM.

Reply With Quote
  #7  
Old July 6th, 2009, 09:08 AM
mehere's Avatar
mehere mehere is offline
Senior Sarcasm Wizardess
ASP Free God 17th Plane (13000 - 13499 posts)
 
Join Date: Feb 2005
Location: Dreamland
Posts: 13,237 mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)  Folding Points: 10976 Folding Title: Novice Folder
Time spent in forums: 5 Months 1 Day 20 h
Reputation Power: 2012
If you don't need an ELSE statement you can put the info on one line and just ignore the END IF. if it's not on one line, then you must include the END IF.
Comments on this post
Guddu agrees: Thanks mehere.
__________________
Come JOIN the party!!!

Quote of the Month:
Pretension: The downside of being better than everyone else is that people tend to assume you're pretentious.

Questions to Ponder:
You can be overwhelmed and underwhelmed, but why can't you be simply whelmed?

iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
copyright© 2008 sbenj69

Reply With Quote
  #8  
Old July 6th, 2009, 10:17 AM
cecilia cecilia is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 35 cecilia User rank is Corporal (100 - 500 Reputation Level)cecilia User rank is Corporal (100 - 500 Reputation Level)cecilia User rank is Corporal (100 - 500 Reputation Level)cecilia User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 23 h 2 m 48 sec
Reputation Power: 2
Quote:
Originally Posted by mystic7
Both of our methods work. Just choose whichever one looks neater


Hi guys,

Both of the methods don't work. Beacause when I select
a item. The code does not redirect to the ShoppingCart.asp page.

Sorry.

Note: I put the code on a sol1.asp when i test the code.

Thanks,

Cecilia

Reply With Quote
  #9  
Old July 6th, 2009, 12:10 PM
mystic7's Avatar
mystic7 mystic7 is offline
Contributing User
Click here for more information.
 
Join Date: Sep 2006
Posts: 1,480 mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 11 h 7 m 17 sec
Reputation Power: 270
I uploaded both my code and guddu's code to my server. When I go to http://myserver.com/yourdropdownpage.asp?ShippingCost=1 or 15.95 or whatever else choice you listed, it worked every time, with my code and with guddu's.

What's NOT working is the method you're using to call this page. You only asked for someone to simplify your code. You didn't say anything about redirecting to shoppingcart.asp.

Reply With Quote
  #10  
Old July 6th, 2009, 02:30 PM
cecilia cecilia is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 35 cecilia User rank is Corporal (100 - 500 Reputation Level)cecilia User rank is Corporal (100 - 500 Reputation Level)cecilia User rank is Corporal (100 - 500 Reputation Level)cecilia User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 23 h 2 m 48 sec
Reputation Power: 2
Hi mystic7,

I forgot to mention about the redirecting to the shoppingcart.asp page

Sorry about that.

Cecilia

Reply With Quote
  #11  
Old July 6th, 2009, 02:58 PM
cecilia cecilia is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 35 cecilia User rank is Corporal (100 - 500 Reputation Level)cecilia User rank is Corporal (100 - 500 Reputation Level)cecilia User rank is Corporal (100 - 500 Reputation Level)cecilia User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 23 h 2 m 48 sec
Reputation Power: 2
!

Quote:
Originally Posted by cecilia
Hi guys,

Both of the methods don't work. Beacause when I select
a item. The code does not redirect to the ShoppingCart.asp page.

Sorry.

Note: I put the code on a sol1.asp when i test the code.

Thanks,

Cecilia


Hi,

It is working now after I re-name sol1.asp to ShoppingCart.asp

Thank you for your help again!

Cecilia

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > If possible, then please re-write my code. Thanks!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
Stay green...Green IT