Forums

Table Calculation

czr2w1 26 Jul, 2011
I have a form that when used, submits a numeric value for each answer on the form. Is there a way when submitted or when the data is stored in the table to add these fields together and show a sum of the fileds. If so, how is this done?
GreyHead 27 Jul, 2011
Hi czr2w1 ,

Yes, you can either do this with JavaScript in the browser - which will show the result to the user; or you can use PHP in a Custom Code box after the form is submitted.

Bob
czr2w1 27 Jul, 2011
Is there a way to do this in the database after the results have been posted. The reason why I ask is that I am not having luck getting the javascript code to work correctly at the moment and I am on a tight deadline. Just wondering if there is a way to add an extra field in the database that sums up the field attributes.
GreyHead 27 Jul, 2011
Hi czr2w1,

Possibly, but I don't know how. PHP in a Custom code action before the DB Save will work as well.

Bob
This topic is locked and no more replies can be posted.