uShop English (U.S.) for 179!

uStorekeeper English (U.S.) for 149!

 Products
       uTest
       uReserve
       uShop
       uStorekeeper
       uGolf
       uDirectory
       uSignIn
 Tech Support
       Support Policy
       Knowledge Base
            uTest
            uReserve
            uShop
            uStorekeeper
            uGolf
            uDirectory
            uSignIn
       Documentation
       Reference Sites
 Legal
       Software Piracy
       Legal Notices
       Privacy Policy
       Licensing
 Miscellaneous
       Reseller Info
       Contact Us
       Site Map
FAO: Bill Weiner

Knowledge Base Lobby : uShop Support Conference : Programmer Tips
Nov-19-17 03:44 AM EST
Original Message
FAO: Bill Weiner
Author Dan on 08-08-2002 at 11:14 (EST)
Hi Bill,

I put up a message about using javascript with chckboxes/radio butons and I have got this working but I am having 2 small problems.

Would you mind taking a look at the following page for me, http://www.clients.sjidesign.com/ushop/demo/indexl.html then click on Products and click on Caffè porcellana espresso pot, and seeing if you can help with the following

1. You will see that I have Large and Small options, how can I make the Large pot £39.95 and the Small Pot £34.95 (you helped me with this before but I am not using applets now, this is a javascript and The same code won't work)

2. I need three colour radio buttons Black, Blue, Red. I have got 2 working (Black & Red) but when I add a third (for the Blue) I cant getit woking, I copied the same code I used for the previous two colours and changed it to what I wanted but I kept getting 2 of the Red colours added to the basket instead of 2 different ones.

Many thanks in advance for your help.

Regards

Dan
TABLE OF CONTENTS

Table Of Contents
  RE: FAO: Bill Weiner Bill Weiner, 2002-08-09 04:41:30 (1)
            Thanks Bill Dan, 2002-08-09 09:48:28 (2)

Messages In This Discussion
         1. RE: FAO: Bill Weiner
        Author Bill Weiner on 08-09-2002 at 04:41 (EST)
PART I. Here is some JavaScript code to set a "price" variable based on the selected size:

(hopefully none of these lines will line-wrap)

// Initialize the price variable.
var price = "34.94";

// Get the selected size.
var size = document.CPorce.size.options[document.CPorce.size.selectedIndex].value;

// Adjust the price based on the size.
if (size == "Large")
{
price = "39.95";
}
else
{
price = "34.95";
}


PART II. Here is some JavaScript code to get the selected size:

// Initialize the colour variable.
var colour = "Black";

// Set the colour variable.
if (document.CPorce.colour[0].checked == true)
{
colour = document.CPorce.colour[0].value;
}
else if (document.CPorce.colour[1].checked == true)
{
colour = document.CPorce.colour[1].value;
}
else
{
colour = document.CPorce.colour[2].value;
}
TABLE OF CONTENTS
                 2. Thanks Bill
                Author Dan on 08-09-2002 at 09:48 (EST)
Thanks Bill,

I had just got the price option working a few minutes before seeing your post but thanks to your code I then got the colour options working.

Thanks again, you are a real help.

Dan
TABLE OF CONTENTS

© 2003 Microburst Technologies, Inc.