Re: parent/child issue

by "Jeff Pearson" <sales(at)webalchemy.on.ca>

 Date:  Fri, 7 Jun 2002 11:06:40 -0400
 To:  "HWG Languages" <hwg-languages(at)hwg.org>
 References: 
  todo: View Thread, Original
Hi Micah,

Ok - I see what you are doing here but how would I make this dynamic? It
needs to be different depending on the values of the CatalogID & ProductID
in the querystring. I just have to filter my results to a singular price for
a given product - all values are being pulled from an Access DB and I didn't
want to hit the database again when the size menu is changed since I pull
the corresponding price from the initial time the page is loaded (with the
ProductID).

Does that make sense?

Jeff
----- Original Message -----
From: "Micah R. Condon" <micahc(at)webdezyne.com>
To: "Jeff Pearson" <sales(at)webalchemy.on.ca>
Sent: Friday, June 07, 2002 3:59 AM
Subject: RE: parent/child issue


> Jeff -
>
> It's late night so the following code may not be bug-free or cross-browser
> :-)
>
>
> <SCRIPT>
>
> // make a hash of the sizes and prices for this item
> var hshPricesBySize = new Object();
> hshPricesBySize["small"] = 5.00;
> hshPricesBySize["medium"] = 5.00;
> hshPricesBySize["large"] = 6.00;
> hshPricesBySize["xlarge"] = 6.00;
> hshPricesBySize["xxlarge"] = 6.50;
>
> // on change in the dropdown, look up the corresponding price in the hash
>
> function lookupPrice(size) {
>
> if(typeof hshPricesBySize[size] != 'undefined'
> && typeof document.forms[0] != 'undefined'
> && typeof document.forms[0].myHiddenPriceField != 'undefined') {
>
> document.forms[0].myHiddenPriceField.value = hshPricesBySize[size];
>
> }
>
> }
>
> </SCRIPT>
>
>
> <SELECT ONCHANGE="lookupPrice(this.options[this.selectedIndex].value);">
> <OPTION>small</OPTION>
> <OPTION>medium</OPTION>
> <OPTION>large</OPTION>
> <OPTION>xlarge</OPTION>
> <OPTION>xxlarge</OPTION>
> </SELECT>
>
>
>
>
> Good luck!
>
> Micah R. Condon
>
>
>
>
> -----Original Message-----
> From: owner-hwg-languages(at)hwg.org [mailto:owner-hwg-languages(at)hwg.org]On
> Behalf Of Jeff Pearson
> Sent: Thursday, June 06, 2002 9:27 PM
> To: HWG Languages
> Subject: parent/child issue
>
>
> Hello,
>
> I am pulling my hair out trying to find a way to do this with my limited
> programming knowledge. I have a recordset that containscolors, sizes and
> prices. I have 2 dynamic dropdown listing of sizes and another with
colors.
> The price is size dependant but not every size has a different price. I
> would like to write the price that corresponds to the specific size (by
use
> of JavaScript when the size drop down menu is changed) to a hidden field
for
> inclusion in the form so i have indiviual values for price, size and
color.
> All the dynamic menus work great. The form is adding an item to a shopping
> cart. I didn't want to reload the page or pass values in a querystring
again
> if possible.
>
> TIA
>
> Jeff
>

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA