BrightNail
11-04-2002, 08:36 AM
Hey all,
I have an issue that needs some attention and is rather complicated...I need some advice....or solution if possible...
I have some info brought back to me from a database......
and each reiteration gives me 2 dropdown selects for each FOREACH loop..so
quantity .................adult
quantity ..................child
quantity .................child
NOW, if some selects an adult price OR child price dropdown to a certain price.........ALL the other NON quanitity drop downs change to reflect that selection and those prices larger....so for example...
adult....value=1.....$3
....value=2.....$12
......value=3....$15.50
........value=4.....$22.00
if someone selects $12 from the dropdown...THEN the child dropselect dropdowns..will show the pricing that is the same or greater.........
NOW, all the selections LOAD with all prices...its just when somenoe selects a "certain' price..then all the "OTHER' dropdowns...then reflect that change...based on the "VALUE"...so, in the example above....the adult VALUE=2 was selected...SO all the children dropdowns would then show ONLY value=2 or higher......
same for a child..if someone selects a child...then the adult and OTHER child pricing would then reflect that change....cause the prices can change..but 'level/value' will be the same...
I was thinking of creating some arrays for EACH select dropdown...the 'value' would represent its position in the array...
so,,,when someone selected a dropdown value...I'd call a function that reiterated thru the available select boxes and then I'd repopulate them by comparing the value number to the array..and then 'build' the NEW dropdowns from the array with the value number and higher in the array..
ala...
adult1=new Array [1,10,12,14,22]
child1=new Array [1,11,12,15,20]
child2=new Array [1,10.50,12,13,22]
if someone selected '12' from the adult dropdown...then that would be array position "2"...thus, I would then reiterate thru everything and popuplate the "child" select dropdowns with their respective arrays..but start at '2' position????
what do you suggest?
I have an issue that needs some attention and is rather complicated...I need some advice....or solution if possible...
I have some info brought back to me from a database......
and each reiteration gives me 2 dropdown selects for each FOREACH loop..so
quantity .................adult
quantity ..................child
quantity .................child
NOW, if some selects an adult price OR child price dropdown to a certain price.........ALL the other NON quanitity drop downs change to reflect that selection and those prices larger....so for example...
adult....value=1.....$3
....value=2.....$12
......value=3....$15.50
........value=4.....$22.00
if someone selects $12 from the dropdown...THEN the child dropselect dropdowns..will show the pricing that is the same or greater.........
NOW, all the selections LOAD with all prices...its just when somenoe selects a "certain' price..then all the "OTHER' dropdowns...then reflect that change...based on the "VALUE"...so, in the example above....the adult VALUE=2 was selected...SO all the children dropdowns would then show ONLY value=2 or higher......
same for a child..if someone selects a child...then the adult and OTHER child pricing would then reflect that change....cause the prices can change..but 'level/value' will be the same...
I was thinking of creating some arrays for EACH select dropdown...the 'value' would represent its position in the array...
so,,,when someone selected a dropdown value...I'd call a function that reiterated thru the available select boxes and then I'd repopulate them by comparing the value number to the array..and then 'build' the NEW dropdowns from the array with the value number and higher in the array..
ala...
adult1=new Array [1,10,12,14,22]
child1=new Array [1,11,12,15,20]
child2=new Array [1,10.50,12,13,22]
if someone selected '12' from the adult dropdown...then that would be array position "2"...thus, I would then reiterate thru everything and popuplate the "child" select dropdowns with their respective arrays..but start at '2' position????
what do you suggest?