Community Forums 

Main Content

Re:Color dropdown does not appear

    Aug 27 2011 07:12:49

    #1

    anandmahey

    Join date : 2011-08-25      Posts : 11

    Thank you Debbie and GT. Both are great suggestions.

    I'll be using Debbie's idea, coz it reduces the work for a customer when they want to place a order.

    I'd like to add a clear selection button, which clears the cart as well, to each item.

    Would also like to add a clear all button which clears the cart as well. The current "clear selection" button does not update the "display cart contents on the same page" (http://www.malsforms.com/display-cart.html) and does not clear the cart.

    appreciate the help.

    This is the code so far:

    <html>

    <head>

    <script type="text/javascript">
    function upDate(){
    qty="0"; sub="0.00";
    querystring=parent.document.URL.substring(document.URL.indexOf('?')+1);
    if (querystring.charAt(0)!="q"){querystring="";}
    if (querystring){
    today=new Date();
    millisecs_in_half_hour=1800000;
    expireDate = new Date(today.getTime() + millisecs_in_half_hour);
    document.cookie=querystring+"&exp="+expireDate+";path=/;expires="+expireDate.toGMTString();
    }else{
    if (document.cookie !=""){
    thisCookie=document.cookie.split("; ");
    for (i=0; i<thisCookie.length; i++) {
    if (thisCookie.split("=")[0]=="qty"){
    querystring=thisCookie;
    expireDate=thisCookie.split("exp=")[1];
    }}}}
    if (querystring){
    querystring=querystring.split("&");
    qty=querystring[0].split("=")[1]; if (qty==""){qty="0";}qty=parseInt(qty);
    sub=querystring[1].split("=")[1]; if (sub==""){sub="0.00";}
    }
    update=document.write("Items in cart: "+qty+"<br>Subtotal: "+sub+"");
    return update;
    }
    </script>

    </head




    <body>

    <script type="text/javascript">upDate()</script>
    <a href="http://ww12.aitsafe.com/cf/review.cfm?userid=E9120065&amp;return=www.malsforms.com/display-cart.html">View your cart/checkout</a>

    <form action="http://ww12.aitsafe.com/cf/addmulti.cfm"; method="post">
    <input type="hidden" name="userid" value="E9120065">
    <input type="hidden" name="return" value="www.maheybrothers.com/testcart.html">;
    <input type="hidden" name="nocart">


    <input type="hidden" name="productpr1" value="Taffeta Velvet, :20.00:1">
    Color:<select name="product1[]">
    <option selected="Red">Red</option>
    <option value="White">White</option>
    <option value="black">black</option>
    </select>
    Quantity:<input type="text" name="qty1" size="2">

    <br>

    <input type="hidden" name="productpr2" value="Satin, :20.00:1">
    Color:<select name="product2[]">
    <option selected="Red">Red</option>
    <option value="White">White</option>
    <option value="black">black</option>
    </select>
    Quantity:<input type="text" name="qty2" size="2">


    <input type="submit" value="Order my Cider">



    <input type="reset" name="Clear your selection" value="Clear your selection">
    <input type="submit" name="Submit" value="Add to order" onclick="alert('Order has been added to your cart\n\nThis page will refresh');">
    </form>
    </body>
    </html>