Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Using onchange to sum dropdown lists
Old 08-13-2008, 11:19 AM Using onchange to sum dropdown lists
Junior Talker

Posts: 1
Trades: 0
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!
amtk54 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Using onchange to sum dropdown lists
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45438 seconds with 12 queries