Welcome to WebmasterWorld Guest from 54.198.210.67

Forum Moderators: open

Message Too Old, No Replies

# Javascript function problem

## values keep varying

#### Birdman

5:45 pm on May 31, 2002 (gmt 0)

#### Senior Member

joined:Apr 22, 2002
posts:2546

Hello WW. This is only part of the function. It's kind of long so I wasn't sure if I should post the whole thing. It is listed as my homepage now, if anyone feels like looking at it.
var calcveil1=(((length1 * 20)+((trimcost * 1) + motifcost)) + ((length2 * 20)+((trimcost * 1) + motifcost)) + ((length3 * 20)+((trimcost * 1) + motifcost))) * .01
var calcveil2=Math.round((calcveil1 + 1))
var showchoices="You selected a " + mat + " bridal illusion veil with " + trim + " edge and " + motif + " motif. Tier 1 is " + length1 + " inches. Tier 2 is " + length2 + " inches. Tier 3 is " + length3 + " inches. The total cost for your handmade veil is \$" + calcveil2 + ". Nice choice!";
var sOrder = "https://www.paypal.com/cart/add=1&business=m00n106%40aol.com&item_name=Veil w/" + mat + " illusion and "+trim+" edge. Tier 1 is "+length1+" in. Tier 2 is "+length2+" in. Tier 3 is "+length3+" in. Motif:"+motif+"blusher:"+blusher+"in. Pouf:"+pouf+"in.&item_number=Custom&amount="+ calcveil2;

window.open(sOrder,'cartwin','width=600,height=400,scrollbars,location,resizable,status');

The problem is that "calcveil2" shows a higher price in the alert than it does on the "window.open" string.
Any help is appreciated.
Birdman

#### tedster

12:12 am on June 1, 2002 (gmt 0)

#### Senior Member

joined:May 26, 2000
posts:37301

I can't immediately see why - what happens if you move the alert line after the variable declaration for sOrder?