homepage Welcome to WebmasterWorld Guest from 23.22.173.58
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Javascript function problem
values keep varying
Birdman

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 125 posted 5:45 pm on May 31, 2002 (gmt 0)

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!";
alert(showchoices);
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

WebmasterWorld Senior Member tedster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 125 posted 12:12 am on Jun 1, 2002 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved