www.uburst.com www.uburst.com

"FAO: Bill Weiner"

Go back to the LobbyClick here to Go Back to Main ListingClick here to see helpClick here to Search the Forum

Programmer Tips
Forum Type: Public
Moderator: edmunds
Time Zone: EST
Printer Friendly Format
Original Message
 
"FAO: Bill Weiner"
Posted by Dan on Aug-08-02 at 11:14 AM (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

Click to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents

 Table of Contents

RE: FAO: Bill Weiner, Bill Weiner, Aug-09-02, (1)
Thanks Bill, Dan, Aug-09-02, (2)

 

 
Click here to goto Click here to goto the Lobby
Messages in this discussion
 
1 . "RE: FAO: Bill Weiner"
Posted by Bill Weiner on Aug-09-02 at 04:41 AM (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;
}

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
2 . "Thanks Bill"
Posted by Dan on Aug-09-02 at 09:48 AM (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

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents


Archive This Thread: Admin and Moderator OnlyRemove This Thread: Admin and Moderator Only
Click here to goto Click here to goto the Lobby

 

 

 

 

 

 

 

 

 

 

 

 
Questions or problems regarding this bulletin board should be directed to Webmaster
©1997-1999 by DCScripts. All rights reserved.