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
Help needed with a Form

Knowledge Base Lobby : uShop Support Conference : Programmer Tips
Nov-23-17 10:52 PM EST
Original Message
Help needed with a Form
Author Deroy on 06-27-2002 at 07:54 (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
E-MAIL AUTHOR | TABLE OF CONTENTS

Table Of Contents
  RE: Help needed with a Form Bill Weiner, 2002-06-28 05:17:20 (1)
            "RE: Help needed with a Form" Deroy, 2002-06-28 06:32:33 (2)
                 RE: Help needed with a Form Bill Weiner, 2002-07-01 04:44:26 (3)
                      "RE: Help needed with a Form" Deroy, 2002-07-01 04:57:33 (4)
                           ""RE: Help needed with a Form"" Deroy, 2002-07-01 04:59:43 (5)
                                Thanks A Lot Bill Deroy, 2002-07-01 05:29:23 (6)
                                     RE: Thanks A Lot Bill Bill Weiner, 2002-07-02 04:48:06 (7)

Messages In This Discussion
         1. RE: Help needed with a Form
        Author Bill Weiner on 06-28-2002 at 05:17 (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.
TABLE OF CONTENTS
                 2. "RE: Help needed with a Form"
                Author Deroy on 06-28-2002 at 06:32 (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
TABLE OF CONTENTS
                         3. RE: Help needed with a Form
                        Author Bill Weiner on 07-01-2002 at 04:44 (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(....);
}
TABLE OF CONTENTS
                                 4. "RE: Help needed with a Form"
                                Author Deroy on 07-01-2002 at 04:57 (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(....);
}
TABLE OF CONTENTS
                                         5. ""RE: Help needed with a Form""
                                        Author Deroy on 07-01-2002 at 04:59 (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
TABLE OF CONTENTS
                                                 6. Thanks A Lot Bill
                                                Author Deroy on 07-01-2002 at 05:29 (EST)
I have managed to get the code working now exactly how I need it. Thanks very much :)

Dan
TABLE OF CONTENTS
                                                         7. RE: Thanks A Lot Bill
                                                        Author Bill Weiner on 07-02-2002 at 04:48 (EST)
Great! Glad you got it working!
TABLE OF CONTENTS

© 2003 Microburst Technologies, Inc.