<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>ProductCart Shopping Cart Software Forums : Custom page add to cart with opti&#111;ns</title>
  <link>https://forum.productcart.com/</link>
  <description><![CDATA[This is an XML content feed of; ProductCart Shopping Cart Software Forums : Customizing ProductCart : Custom page add to cart with opti&#111;ns]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 11 Apr 2026 05:16:02 +0000</pubDate>
  <lastBuildDate>Tue, 17 Oct 2006 01:29:33 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>https://forum.productcart.com/RSS_post_feed.asp?TID=463</WebWizForums:feedURL>
  <image>
   <title><![CDATA[ProductCart Shopping Cart Software Forums]]></title>
   <url>https://forum.productcart.com/forum_images/pc_logo_50.png</url>
   <link>https://forum.productcart.com/</link>
  </image>
  <item>
   <title><![CDATA[Custom page add to cart with opti&#111;ns : You will  need to create on validation...]]></title>
   <link>https://forum.productcart.com/custom-page-add-to-cart-with-options_topic463_post1454.html#1454</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://forum.productcart.com/member_profile.asp?PF=213">Matt</a><br /><strong>Subject:</strong> 463<br /><strong>Posted:</strong> 17-October-2006 at 1:29am<br /><br /><p ="Ms&#111;normal"><span style="font-size: 10pt; font-family: Tahoma;">You will need to create on validation function for each form on the page, or modify the function to receive the form's name as a parameter.<O:P><br></O:P></span></p><p ="Ms&#111;normal"><b><span style="font-size: 10pt; font-family: Tahoma;">For example</span> </b><span style="font-size: 10pt; font-family: Tahoma;">, the first product with options is contained within a form named "<span style="background: yellow n&#111;ne repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">additem6</span>".<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="font-size: 10pt; font-family: Tahoma;">Therefore the function will not work unless "additem6" is part of its path.</span> <O:P><br></O:P></p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';">function cdd(choice, option) {<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>if (choice== 0) {<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>alert ("The product cannot be added to the shopping cart.\n"+ option + " is a required option.\n");<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>} else { <O:P></O:P></span></p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span>document.<span style="background: yellow n&#111;ne repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">additem6</span>.action="/store/pc/instPrd.asp";<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span>document.<span style="background: yellow n&#111;ne repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">additem6</span>.method="POST";<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span>document.<span style="background: yellow n&#111;ne repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">additem6</span>.submit();<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';">}<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="font-size: 10pt; font-family: 'Courier New';"><O:P>&nbsp;</O:P> </span></p><p ="Ms&#111;normal"><span style="font-size: 10pt; font-family: Tahoma;">Therefore your next product can not use the same function "cdd", since this function only works with the form "additem6".<span>&nbsp; </span>So if the next form on the page is called "<span style="background: yellow n&#111;ne repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">additem7</span>" you will need a new function.<O:P><br></O:P></span></p><p ="Ms&#111;normal"><span style="font-size: 10pt; font-family: Tahoma;">For a better, more compact alternative you could just pass the name of the form into one dynamic function.<span>&nbsp; </span>That would look something like this:<O:P><br></O:P></span></p><p ="Ms&#111;normal"><b><u><span style="font-size: 10pt; font-family: Tahoma;">Function Call<O:P></O:P></span> </u></b></p><p ="Ms&#111;normal"><span style="font-size: 10pt; font-family: Tahoma;"><O:P>&nbsp;</O:P> </span></p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';"> cddMulti(additem6.idOptionA.selectedIndex,'Size','additem6') ;<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="font-size: 10pt; font-family: Tahoma;"><O:P>&nbsp;</O:P> </span></p><p ="Ms&#111;normal"><span style="font-size: 10pt; font-family: Tahoma;"><O:P>&nbsp;</O:P> </span></p><p ="Ms&#111;normal"><b><u><span style="font-size: 10pt; font-family: Tahoma;">Function<O:P></O:P></span> </u></b></p><p ="Ms&#111;normal"><span style="font-size: 10pt; font-family: Tahoma;"><O:P>&nbsp;</O:P> </span></p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';">function cddMulti(choice, option, <span style="background: yellow n&#111;ne repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">formname</span>) {<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="background: yellow n&#111;ne repeat scroll 0% 50%; font-size: 8pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: 'Courier New';">var targeForm = eval("document." + formname + "");</span> <span style="font-size: 8pt; font-family: 'Courier New';"><O:P></O:P></span></p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';">if (choice== 0) {<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>alert ("The product cannot be added to the shopping cart.\n"+ option + " is a required option.\n");<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>} else { <O:P></O:P></span></p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: yellow n&#111;ne repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">targeForm</span>.action="/store/pc/instPrd.asp";<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: yellow n&#111;ne repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">targeForm</span>.method="POST";<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: yellow n&#111;ne repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">targeForm</span>.submit();<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="font-size: 8pt; font-family: 'Courier New';">}<O:P></O:P></span> </p><p ="Ms&#111;normal"><span style="font-size: 10pt; font-family: Tahoma;"><O:P>&nbsp;</O:P> </span></p><p ="Ms&#111;normal"><span style="font-size: 10pt; font-family: Tahoma;">We hope this helps!<br><O:P></O:P></span></p>]]>
   </description>
   <pubDate>Tue, 17 Oct 2006 01:29:33 +0000</pubDate>
   <guid isPermaLink="true">https://forum.productcart.com/custom-page-add-to-cart-with-options_topic463_post1454.html#1454</guid>
  </item> 
  <item>
   <title><![CDATA[Custom page add to cart with opti&#111;ns : I created this page, and the last...]]></title>
   <link>https://forum.productcart.com/custom-page-add-to-cart-with-options_topic463_post1363.html#1363</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://forum.productcart.com/member_profile.asp?PF=290">Greg Dinger</a><br /><strong>Subject:</strong> 463<br /><strong>Posted:</strong> 23-September-2006 at 10:21pm<br /><br /><P>I created this page, and the last 2 items have options for "size".<BR><A href="http://www.opakallc.com/bosstin.asp" target="_blank">http://www.opakallc.com/bosstin.asp</A></P><P>I find that "add to cart" (for those 2 items, the others work fine)&nbsp;results in a redirect to the home page instead of adding the qty to the cart. </P><P>Comparing the code to the normal detail page, I don't see a difference in terms of the form action or the input fields:<BR><A href="http://www.opakallc.com/store/pc/viewPrd.asp?idproduct=18" target="_blank">http://www.opakallc.com/store/pc/viewPrd.asp?idproduct=18</A></P><P>Would someone mind shedding some light upon what I might be overlooking?</P><P>Thanks much,<BR>Greg</P><P>&nbsp;</P><P>&nbsp;</P><span style="font-size:10px"><br /><br />Edited by Greg Dinger - 23-September-2006 at 10:22pm</span>]]>
   </description>
   <pubDate>Sat, 23 Sep 2006 22:21:48 +0000</pubDate>
   <guid isPermaLink="true">https://forum.productcart.com/custom-page-add-to-cart-with-options_topic463_post1363.html#1363</guid>
  </item> 
 </channel>
</rss>