Back to Mal's forms page
<<< Clicking on this logo will return you to my Mal's Forms home page.

View the page source!


Copy the scripts into the head area plus this line:
<meta http-equiv="Content-Script-Type" content="text/javascript">

Here we have two products, the first has a minimum order quantity of 25, the second is 50. Click on the first button, then the second to confirm this.

As we have two minimum qty values, we have to have two scripts controlling this element, right click on the page/view page source.

To start, use a different form and name for each minimum, so if one set of products has a minimum of 25 and another set has 50 as with this page, we have to create two forms. The key is linking each form to each script, we do this by giving each form a name... name="Form1" name="Form2". For the second form, change the form name to suit and the return ChkQty(this) to return ChkQty2(this) or the next form number you're using.

So that's the forms taken care of, now let's look at the scripts... The first script has three lines needing your attention and altering:
function calcQty()
F = document.Form;
F.qty.value = Number(F.qty1.value) + Number(F.qty2.value);

The values for these lines are fairly self explanatory if you look at the difference between the first form/script and the second.

You can make the text qty box hidden if you want to.

4x5 MATTE Photo Cards 0.40 each
5x7 MATTE Photo Cards 0.48 each
4x5 GLOSSY Photo Cards 0.40 each
5X7 GLOSSY Photo Cards 0.48 each

T Shirt in yellow $15.00, quantity:   Small | Medium | Large
T Shirt in red $15.00, quantity: Small | Medium | Large