Campbell Ritchie wrote:Can you make the selected items in each of the boxes into a collection and do anything like this on it? That will avoid your having to iterate the box 5×.
Duplicating discussion in our VB forum.
Bear Bibeault wrote:Exactly how is it not working? What's happening differently than your expectations?
Have you learned how to set breakpoints to help with debugging?
Jeanne Boyarsky wrote:Daniel,
Do you have a question about that code or just sharing? Is there something in particular that doesn't work?
Bear Bibeault wrote:In order to use getElementById, the element must have an id. The name is not the same as an id. (name is only used for form submission, so you don't really even need one here.)
There is also getElementsByName if you want to continue to use names.
Bear Bibeault wrote:No, those variables are undefined in the onchange handler.
It seems you are just guessing at this point; you need to ask yourself what values you want to actually pass into the function. When onchange triggers, what is it you actually want to have happen?
Bear Bibeault wrote:No, those variables are undefined in the onchange handler.
It seems you are just guessing at this point; you need to ask yourself what values you want to actually pass into the function. When onchange triggers, what is it you actually want to have happen?
Bear Bibeault wrote:In the following code, where do you pass two numbers?
You pass nothing.
What is it you want to be multiplying together? Those values need to be passed to the function.