|
I appreciate any input on this that anyone may have, as I have pretty much zero experience with javascript. This project was handed to me at work and I know its not a difficult thing to do, but I'm not quite sure what needs to be done.
Basically I have a page with five dropdown menus. Each dropdown menu is numbered 1-5. At the bottom of the page is a box. When a value from a menu is chosen, it should sum with the other values of the other menus in the box at the bottom. If the user chooses numbers that sum to exceed 5, then I want a message displayed - which I've figured out can be done with alert("Only a total of five bus passes may be purchased per order.").
Ultimately the contents of the form will be submitted using a web mail script, but I can handle that aspect of it. I was just wondering if anyone could assist in the javascript aspect.
For instance, here is one of the dropdowns:
<select name="Adult 10-ride" id="Adult 10-ride" onchange="???">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
I'm not quite sure what to put in "onchange" I know I need to call a function that will take care of what I need, but I'm not sure how to format that function or send the selected value from the dropdown to the function.
Thanks!
|