Basically I have a form which right now has 2 drop downs with weights to each item.
I need on the page for a total value to be calculated based off the weights from the drop downs.
This would be displayed in a box which would change colour based on how high the value gets.
For example drop down 1 would be Item1 = One, weight = 1 Item2 = Two, weight = 2 etc etc.
The math would be (drop down 1’s selected item weight) * (drop down 2’s selected item weight).
Each drop down would have only 5 items with weights from 1-5.
Right now I have 2 tables storing the data regarding the 2 drop downs, if it’s easier to do it another was to produce the end result easier then I’ll go for that.
I’ll try and update tomorrow this topic with the experiments I’ve done so far but if anybody has any ideas I’m all ears.
If I’ve understood your question correctly, what about something like this?
The idea is to attach a
changeevent to yourselectelements (you may need to change the selector to be more specific if you have more on your page). In the event handler, we get the value of the 2selectelements in question, multiply them, and write the result to adiv. The background colour of thedivis then changed depending on what the total value was.