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
ushop

Knowledge Base Lobby : uShop Support Conference : Programmer Tips
Nov-21-17 05:03 AM EST
Original Message
ushop
Author roger on 04-10-2002 at 09:01 (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

E-MAIL AUTHOR | TABLE OF CONTENTS

Table Of Contents
  RE: ushop Bill Weiner, 2002-04-11 05:41:19 (1)

Messages In This Discussion
         1. RE: ushop
        Author Bill Weiner on 04-11-2002 at 05:41 (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.
TABLE OF CONTENTS

© 2003 Microburst Technologies, Inc.