SUM Repeat Rows in form WHERE Condition

nbradshaw

Active Member
I have a Repeat Group where I SUM a Totals column - this works as expected using this code:

PHP:
$total_footage = (array) $data['bid_package_43_repeat___total_footage_raw'];
return array_sum($total_footage);

However, I also need to separately SUM rows where a Radio Button is selected within each of the repeat rows (via Ajax).
For instance:
Sub Total Element: | Radiobutton Element:
100 | Checked
50 |
25 | Checked


So my 2 Calc Elements:
Total: 175 (This is from the code above - which is working fine)
Checked Total: 125

I need this to calculate in real time (ajax) when a user selects each individual radiobutton for each row within the repeat section.

Thoughts?
 
Guess you'll need to loop through your repeat groups and, for each, see if the radio is checked, and if so, add the corresponding Sub Total value to a variable (which was initially 0).
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top