For coding questions, it's all but impossible to troubleshoot without seeing the applicable code. However, a start might be to add an alert to your "little javascript" to ensure that it is being called both times (when the order unit is initially changed and again when it is changed back). I would also alert the current value of the price variable and of the order unit variable to see what is happening to them in each case. It may be that you have inadvertently declared a variable within your function without the var keyword and made it global the first time the function is called (or, OTOH, redeclared a global variable at local scope, changing its value without intending to). Scoping issues such as this can cause unexpected results if that variable is used elsewhere. That's a beginning, but without seeing your script I can advise no further.

Small tip: When alerting variables, include a descriptive string so you know what you're looking at, like this:

alert('The current value of the order unit variable is ' + orderUnit);

Cheers,
Scott
.
----- Original Message ----- From: "Portman" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, July 21, 2005 2:28 PM
Subject: [wdvltalk] JavaScript problem


Hi,

I am adding a shopping cart to someone's website and have a problem with the JavaScript. The buyer can buy items by the package or by the case (which have different prices.) I wrote a little JavaScript to check what has been selected and to set the price accordingly but find that if you choose Case and then choose Package (the default) again, the price won't change back. Any ideas?
http://www.starqualitydesigns.com/blumspapergoods/yoshiware2.htm

TIA,
Riva


____ . The WDVL Discussion List from WDVL.COM . ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or use the web interface http://e-newsletters.internet.com/discussionlists.html/
      Send Your Posts To: [email protected]
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.




____ • The WDVL Discussion List from WDVL.COM • ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
      Send Your Posts To: [email protected]
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Reply via email to