www.uburst.com www.uburst.com

"Help needed with a Form"

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
 
"Help needed with a Form"
Posted by Deroy on Jun-27-02 at 07:54 AM (EST)
Hi,

I am creating a demo site for a client who wants a form with 7 different products on. He only wants 1 add to basket button, but he needs to add any product with a QTY of one or more to the basket with this single button.

I have got a sample page up on http://www.clients.sjidesign.com/ushop/thumbs.html this form is nearly ok but it adds any QTY with 0 to the cart, which I do not want. If the QTY box is clear then it mucks the whole form up.

I have tried using Applet: uShopInput8 but I need to have a dropdown size and colour for 2 of the products.

Anyone got any ideas?

Thanks Dan

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: Help needed with a Form, Bill Weiner, Jun-28-02, (1)
"RE: Help needed with a Form&q..., Deroy, Jun-28-02, (2)
RE: Help needed with a Form, Bill Weiner, Jul-01-02, (3)
"RE: Help needed with a Form&q..., Deroy, Jul-01-02, (4)
""RE: Help needed with a ..., Deroy, Jul-01-02, (5)
Thanks A Lot Bill, Deroy, Jul-01-02, (6)
RE: Thanks A Lot Bill, Bill Weiner, Jul-02-02, (7)

 

 
Click here to goto Click here to goto the Lobby
Messages in this discussion
 
1 . "RE: Help needed with a Form"
Posted by Bill Weiner on Jun-28-02 at 05:17 AM (EST)
I keep getting "Page Not Found" when trying the URL:

http://www.clients.sjidesign.com/ushop/thumbs.html

.... so I couldn't see the sample page that you setup. If you give me the correct URL, I will take a look at it.

If you want to have multiple products ... each with their own quantity button... and and all tied together with a single "Add" button... then I would suggest utilizing a regular HTML form and the uShop JavaScript API to handle that. That is, create the page using regular HTML and a regular HTML FORM to show the product info and quantity entry boxes.... and then setup the "onClick" event of the form's button to analyze the form and add the selected products to the basket.

Refer to the JavaScript "Input Examples" in the uShop Applet Reference:

http://www.uburst.com/uShop/international/uk/reference/

... for examples and additional information about tying regular HTML forms to the uShop Shopping Basket via JavaScript.

Also, refer to the uShop Programmer's Guide:

http://www.uburst.com/uShop/international/uk/reference/programmers_guide.html

... for more information about using JavaScripts with uShop.

And finally, check out the 12/12/2000 posting in our developer's corner at:

http://www.uburst.com/uShop/developers.html

... for an example of how to access an HTML form's fields and add them to the shopping basket.

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 . ""RE: Help needed with a Form""
Posted by Deroy on Jun-28-02 at 06:32 AM (EST)
Hi Bill,

sorry for the wrong link, this is the correct one

http://www.clients.sjidesign.com/ushop/demo/thumbs.html

Thanks for taking a look at it.

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
 
3 . "RE: Help needed with a Form"
Posted by Bill Weiner on Jul-01-02 at 04:44 AM (EST)
Based on your setup, I would suggest just adding a quantity check to each of your "add" JavaScripts... and then only call the uShopJSI.addProduct() function if the quantity is greater than 0. Here is an example:

var qty = parseInt(document.aero01.quantity.value);
if (qty > 0)
{
document.uShopJSI.addProduct(....);
}

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
 
4 . ""RE: Help needed with a Form""
Posted by Deroy on Jul-01-02 at 04:57 AM (EST)
Bill,

Thanks for the help. Can you please tell me what I am doing wrong here, I have written the code out below but when I try and add to the basket I get sent through to the root files on my PC. Have I added your code incorrectly?


function addaero01()
{
document.uShopJSI.addProduct(
"aero01",
"Aerolatte",
"Milk Frother",
"0.5",
document.aero01.quantity.value,
"14.95",
"$0.00",
"$0.00",
"$0.00",
"YES");

var qty = parseInt(document.aero01.quantity.value);
if (qty > 0)
{
document.uShopJSI.addProduct(....);
}

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
 
5 . """RE: Help needed with a Form"""
Posted by Deroy on Jul-01-02 at 04:59 AM (EST)
I see that the whole code doesn't post properly. Could you please have another look at my page, where I have added your code.

Thanks very much for your 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
 
6 . "Thanks A Lot Bill"
Posted by Deroy on Jul-01-02 at 05:29 AM (EST)
I have managed to get the code working now exactly how I need it. Thanks very much :)

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
 
7 . "RE: Thanks A Lot Bill"
Posted by Bill Weiner on Jul-02-02 at 04:48 AM (EST)
Great! Glad you got it working!
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.