uShop English (U.S.) for 179!

uStorekeeper English (U.S.) for 149!

 Tech Support
       Support Policy
       Knowledge Base
       Reference Sites
       Software Piracy
       Legal Notices
       Privacy Policy
       Reseller Info
       Contact Us
       Site Map
LIMIT number of products to max no?

Knowledge Base Lobby : uShop Support Conference : General Questions
Mar-21-18 05:09 AM EST
Original Message
LIMIT number of products to max no?
Author Gary Torello on 04-01-2002 at 11:16 (EST)
Hi again!

I'm playing with the script for a second possible application.. It will be used to browse/search, and send in requests for "library materials".. ($0 price items that will then be shipped on loan to a membership base)

is there a way to limit the number of products in this scenario to a maximum of say 5?



Table Of Contents
  RE: LIMIT number of products to max no? Bill Weiner, 2002-04-02 06:07:17 (1)

Messages In This Discussion
         1. RE: LIMIT number of products to max no?
        Author Bill Weiner on 04-02-2002 at 06:07 (EST)
Here are some steps that could be used to put a maximum limit check on your "Place Order" page:

STEP 1: On your "begin order process" page (or whatever page(s) that you have the "uShopOrderButton" applet on) ... try adding the following JavaScript function:

< SCRIPT LANGUAGE="Javascript" >
function checkQuantity()
var itemCount = document.uShopJSI.getTotalQuantity();
if (itemCount > 5)
alert("Limit 5 per customer.");

You can put that script pretty much anywhere on the page (it won't be visible).

STEP 2: Also on that page, modify the "BODY" line of the page to call the new JavaScript function via the "onLoad" action.

For example, if your "BODY" line of your HTML page is:


Then change it to:

< BODY BGCOLOR="#FFFFFF" onLoad="checkQuantity();" >

STEP 3: And finally, on that page, don't forget to add the special "uShopJSI" applet so that the JavaScript can interface with uShop. The uShopJSI applet can usually put at the very bottom of your page with the following HTML:

< APPLET CODE="uShopJSI.class" CODEBASE="../classes/" NAME="uShopJSI" WIDTH="2" HEIGHT="2" >

NOTE: If you have any questions about using the uShopJSI applet with uShop or with just interfacing JavaScript with uShop, please refer to the "JavaScript Examples" in the uShop Applet Reference:

Or the uShop Programmer's Guide:

© 2003 Microburst Technologies, Inc.