Advertisement

05.15.2008 at 06:24PM PDT, ID: 23407206
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.4

How to calculate total onblur from array of  input fields in a form

Asked by betagirl in JavaScript, Scripting Languages, Web Development

Tags:

Hi -

I've got a form that dynamically generates input fields, based on 'n' records in the db related to an id that is passed to the form page (so the number of inputs may vary each time the form is loaded).

The user will input a number into field  'amount[]' and I need 2 fields lower on the form to update automatically based on the user input.

Field 'total' will calculate the total amount, based on what's been entered in 'amount[]' and the field 'available' will calculate the available amount, based on subtracting the number in the 'grand total' field - which is hard coded (passed into the form upon page load).  

So I need a script that will get the values entered in the 'amount[]' fields and update the 'total' field with the sum of those.

Then I need to subtract the 'total' value that gets generated, from the 'grand total' value (variable passed in) to come up with the proper remaining amount, for the 'available' field.  

All before the form is submitted.  Now, with hard coded values, I can do this using functions like the ones here: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_23094948.html.

I'm having a hard time adapting that code to work with an array of inputs however.

Thanks!Start Free Trial
[+][-]05.15.2008 at 09:38PM PDT, ID: 21580041

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 05:27AM PDT, ID: 21582049

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.17.2008 at 03:58PM PDT, ID: 21591020

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 12:07AM PDT, ID: 21604033

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 10:32AM PDT, ID: 21608359

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.06.2008 at 08:06PM PDT, ID: 21942565

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.06.2008 at 08:42PM PDT, ID: 21942650

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.07.2008 at 01:43AM PDT, ID: 21943421

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.07.2008 at 01:49AM PDT, ID: 21943449

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.07.2008 at 02:32AM PDT, ID: 21943605

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.07.2008 at 02:37AM PDT, ID: 21943621

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: JavaScript, Scripting Languages, Web Development
Tags: Javascript, PHP
Sign Up Now!
Solution Provided By: mplungjan
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.07.2008 at 02:54AM PDT, ID: 21943672

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.07.2008 at 02:54AM PDT, ID: 21943673

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628