Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,576 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,862 people online right now. Registration is fast and FREE... Join Now!




Javascript Total Rows in a Multiple Update Form

 
Reply to this topicStart new topic

Javascript Total Rows in a Multiple Update Form

ningboring
4 Oct, 2008 - 06:23 PM
Post #1

New D.I.C Head
*

Joined: 27 Sep, 2008
Posts: 5

I have a multiple record update form generated by using PHP. I would like to total the fields (rows) using Javascript before submitting the values to the MYSQL database. I can get this working for individual records, but have no idea how to do it for multiple records. Any help greatly appreciated.

Ningboring


Attached thumbnail(s)
Attached Image
User is offlineProfile CardPM
+Quote Post

BetaWar
RE: Javascript Total Rows In A Multiple Update Form
4 Oct, 2008 - 06:47 PM
Post #2

#include <soul.h>
Group Icon

Joined: 7 Sep, 2006
Posts: 2,026



Thanked: 82 times
Dream Kudos: 1175
My Contributions
Well, you already have it mostly done, instead of simply outputting the Total in the last table cell create a variable in your javascript that you have adding up each total as it is calculated.

For instance:
CODE
var totalTotals = 0;
//each time you are adding a total and have it calculated:
totalTotals += newTotal;
//where newTotal is the total for that row of fields.


Hope that helps.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 12:12AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month