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
can't use uShopJSI.class

Knowledge Base Lobby : uShop Support Conference : Problems with trying to Place Orders
Dec-18-17 07:43 AM EST
Original Message
can't use uShopJSI.class
Author wchin on 05-21-2003 at 23:25 (EST)
Dear SIrs,

please check my page at http://www.coolthingsforthehome.com/granite/granite.htm. I can't get the "add to shopping cart" button to work.

see this line:

onclick="addTIS();return false;"
href="">


Where should the "href" point to?

Thanks,

Warren Chin
E-MAIL AUTHOR | TABLE OF CONTENTS

Table Of Contents
  RE: can't use uShopJSI.class Bill Weiner, 2003-05-23 07:23:25 (1)
            question wchin, 2003-05-23 21:57:56 (2)
                 RE: question Bill Weiner, 2003-05-27 05:58:55 (3)

Messages In This Discussion
         1. RE: can't use uShopJSI.class
        Author Bill Weiner on 05-23-2003 at 07:23 (EST)
There are a couple problems on that page:

1) Everywhere on the page where you have:

document.TIS.Choose Knob & Finish.options

... that is causing a JavaScript "missing ) after argument" problem. Instead of using "Choose Knob & Finish" in those places, you need to be using the name given to your "select".... which from looking at your HTML forms, is current set to "select". (By the way, you may want to give those select fields a more meaningful name such as "know_and_finish"). Anyway, if you leave the select name of that field set to "select", then you should be using:

document.TIS.select.options

... in all those places instead of:

document.TIS.Choose Knob & Finish.options


2) Also, I noticed you have multiple JavaScript add buttons on that page.... and for each add button, you have another function called "addTIS()" and a form named "TIS". Unless you make the addTIS() function generic to accept a product ID parameter, you need to give each function and form a unique name.


Refer to the "JavaScript Input Example 3" in the uShop applet reference to see an example of how one button/form should be setup:

http://www.uburst.com/uShop/reference/applets.html

TABLE OF CONTENTS
                 2. question
                Author wchin on 05-23-2003 at 21:57 (EST)
Dear Mr. Weiner,

Can you tell me please how to make the "addTIS()" function generic o that I can tell it to refer to the product ID parameter?

Thanks!

Warren Chin
wchin@pol.net
TABLE OF CONTENTS
                         3. RE: question
                        Author Bill Weiner on 05-27-2003 at 05:58 (EST)
To make your add function "generic", you would set it up to accept the product information as parameters, such as:

function addP00003(prod_id,prod_name,prod_descr,prod_qty,prod_price)
{
document.uShopJSI.addProduct(
prod_id,
prod_name,
prod_descr,
"0",
prod_qty,
prod_price,
"$0.00",
"$0.00",
"$0.00",
"YES");
}

And then call the function with something like this:

onClick="addP00003("P12345","T-Shirt","Size L, Color Blue","1","$19.99");return false;"

or

onClick="addP00003("P12345","T-Shirt",document.FORM1.size.options[document.FORM1.size.selectedIndex].value,document.FORM1.quantity.value,"$19.99");return false;"


Or you could even pass the name of the FORM in as a parameter, such as:

function addP00003(form_name,prod_id,prod_name,prod_descr,prod_qty,prod_price)
{
document.uShopJSI.addProduct(
prod_id,
prod_name,
"" +
document.form_name.size.options[document.form_name.size.selectedIndex].value,
"0",
document.form_name.quantity.value,
prod_price,
"$0.00",
"$0.00",
"$0.00",
"YES");
}
TABLE OF CONTENTS

© 2003 Microburst Technologies, Inc.