JavaScript Problem

Xponential

Senior member
Jun 10, 2001
339
0
71
Ok, what I'm trying to do is add a quantity field in front of my PayPal Add To Cart button. So, when they input the quantity, the right amount displays on the checkout page.

The problem is, I can't for the life of my figure out the proper syntax for it. I found this page that explains what I'm trying to do, but I still can't figure it out.

This is exactly what I'm trying to do:

for quantity of 1, output is $60
for quantity of 2, output is $110
for quantity of 3 or more, output is $50 * quantity

Any help would be greatly appreciated :)
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
if(quantity == 1)output = 60;
else if(quantity == 2)output = 110;
else output = quantity * 50;
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Right between the top of the code you're working on that you didn't post a link to, and the bottom of the code you're working on that you didn't post a link to.
 

jman19

Lifer
Nov 3, 2000
11,225
664
126
Originally posted by: notfred
Right between the top of the code you're working on that you didn't post a link to, and the bottom of the code you're working on that you didn't post a link to.

LOL