Hi,
I'd like to do some calculations with input fields before processing a form (cgi) script, but I'm thinking it might have to be done with javascript?? Anyway, here's the scenario......
Ok, I have a total of four drop down menus (with pre-determined numeric values), with an empty text box in-between the first two and one after the second two.
drop down menu 1
value="10" option 1
value="20" option 2
drop down menu 2
value="25" option 1
value="50" option 2
input txt box which is empty (amount 1)
-------a link/button here which will say calculate menu 1 and 2
drop down menu 3
option 1
option 2
drop down menu 4
option 1
option 2
input txt box which is empty (amount 2)
-------a link/button here which will say calculate menu 3 and 4
an empty txt box for the total amount of both txt box fields above
++++++ a link button here which will say calculate both (amount 1 + amount 2)
now, after clicking the link/button above the value will be placed into an input txt box below here which will total the two values above.
so to sum up what I'm trying to do is this:
A user makes a selection from the first two drop down menus, let's say he chooses option 1 and option 1. He then hits the link/button (which says calculate) and the two values are multiplied giving him a value of 250 in the first text box. He then does the same thing (for demonstration purposes let's say the values are the same) on the second set of drop down menus. So he now has two text fields filled in with the value 250. After he hits the final link/button which says calculate both, the final value will be added to the last text box....so it would be a calculation of value 1 + value 2 = 500.
Ok..it made sense when I was typing it..but it might be confusing when reading it. Like I said I think it might need to be done with javascript....but I'm not sure if I'm better off going with a totally different system. Before I start trying to figure out a solution in javascript, I'd like to get some other ideas and suggestions on how to approach this. BTW- I've thought about just using a shopping cart, but it won't work with the rest of the system. Any input is appreciated.
Thanks
I'd like to do some calculations with input fields before processing a form (cgi) script, but I'm thinking it might have to be done with javascript?? Anyway, here's the scenario......
Ok, I have a total of four drop down menus (with pre-determined numeric values), with an empty text box in-between the first two and one after the second two.
drop down menu 1
value="10" option 1
value="20" option 2
drop down menu 2
value="25" option 1
value="50" option 2
input txt box which is empty (amount 1)
-------a link/button here which will say calculate menu 1 and 2
drop down menu 3
option 1
option 2
drop down menu 4
option 1
option 2
input txt box which is empty (amount 2)
-------a link/button here which will say calculate menu 3 and 4
an empty txt box for the total amount of both txt box fields above
++++++ a link button here which will say calculate both (amount 1 + amount 2)
now, after clicking the link/button above the value will be placed into an input txt box below here which will total the two values above.
so to sum up what I'm trying to do is this:
A user makes a selection from the first two drop down menus, let's say he chooses option 1 and option 1. He then hits the link/button (which says calculate) and the two values are multiplied giving him a value of 250 in the first text box. He then does the same thing (for demonstration purposes let's say the values are the same) on the second set of drop down menus. So he now has two text fields filled in with the value 250. After he hits the final link/button which says calculate both, the final value will be added to the last text box....so it would be a calculation of value 1 + value 2 = 500.
Ok..it made sense when I was typing it..but it might be confusing when reading it. Like I said I think it might need to be done with javascript....but I'm not sure if I'm better off going with a totally different system. Before I start trying to figure out a solution in javascript, I'd like to get some other ideas and suggestions on how to approach this. BTW- I've thought about just using a shopping cart, but it won't work with the rest of the system. Any input is appreciated.
Thanks