www.uburst.com www.uburst.com

"ushop"

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
 
"ushop"
Posted by roger on Apr-10-02 at 09:01 AM (EST)
hi edmund thanks alot previously on the INPUT EXAMPLE 4 option
works great
i was able to add additional input options. kinda understand it now

but i have one other request

in the

INPUT EXAMPLE 4 APPLET

see the drop down list of shirt sizes

S
M
L
XL

i want to put in modifiyer.. where
it adds price to cost

S + $2.00
M + $4.00
L + $6.00
XL + $8.00

I want to add the extra cost to the alrady given price
$24.95
how do i go about that?


Roger

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

 Table of Contents

RE: ushop, Bill Weiner, Apr-11-02, (1)

 

 
Click here to goto Click here to goto the Lobby
Messages in this discussion
 
1 . "RE: ushop"
Posted by Bill Weiner on Apr-11-02 at 05:41 AM (EST)
There a variety of different ways to handle that... perhaps the easiest in this case would be to just add an "if" statement to JavaScript "addP0004" function.... something like this:

// Define a new variable for the price.
var price = 24.95;

// Define a new variable for the size.
var size = document.P00004.size.options[document.P00004.size.selectedIndex].value;

// Add to the price based on the size.
if (size == "S")
{
price = price + 2.0;
}
else if (size == "M")
{
price = price + 4.0;
}
else if (size == "L")
{
price = price + 6.0;
}
else
{
price = price + 8.0;
}

And then just substitue the "price" and the "size" variable in the document.uShopJSI.addProduct() call.

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.