www.uburst.com www.uburst.com

"can't use uShopJSI.class"

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

Problems with trying to place orders.
Forum Type: Public
Moderator: edmunds
Time Zone: EST
Printer Friendly Format
Original Message
 
"can't use uShopJSI.class"
Posted by wchin on May-21-03 at 11:25 PM (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

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: can't use uShopJSI.class, Bill Weiner, May-23-03, (1)
question, wchin, May-23-03, (2)
RE: question, Bill Weiner, May-27-03, (3)

 

 
Click here to goto Click here to goto the Lobby
Messages in this discussion
 
1 . "RE: can't use uShopJSI.class"
Posted by Bill Weiner on May-23-03 at 07:23 AM (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

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 . "question"
Posted by wchin on May-23-03 at 09:57 PM (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

Remove this Message: Administrator and Moderator onlyClick 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
 
3 . "RE: question"
Posted by Bill Weiner on May-27-03 at 05:58 AM (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");
}

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.