More Javascript Problems!!

by Sandy Fields <sandy(at)sannicron.com>

 Date:  Sun, 11 Jun 2000 19:54:36 -0400
 To:  hwg-basics(at)hwg.org
  todo: View Thread, Original
Well I thought I had it figured out, but there's still a glitch.  The 
script will only pick up one price.

No matter which size choice I make (Childrens, Regular, or Plus), once I 
switch the focus to the next selection field (Color Choices), the first 
selection field always reverts back to "Childrens", thereby giving me a 
price of $10.00 no matter what else I've chosen.  I can't get any other 
selection to 'stick'.

Anybody got any ideas on this one?

Here's the script as it is now. I'm leaving out the diagonals on purpose.

script language="JavaScript"
!-- Begin

function cost(){

   if (document.orderForm.category.selectedIndex=0) {
      alert("You didn't select a size category - Childrens, Adults, or Plus.");
}
else if (document.orderForm.category.selectedIndex=1) {
      return(document.orderForm.price.value=10.00)
}
else if (document.orderForm.category.selectedIndex=2) {
      return(document.orderForm.price.value=12.00)
}
else {
    return(document.orderForm.price.value=14.00)
}
}
// End -->
/script

-- Sandy (getting desperate here)

Sannicron Web Design
http://www.sannicron.com

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA