bggann
Active Member
I have a form with repeated groups where I have a calculated field that is displayed to help guide the user in filling out other fields.
The calculation is based on placeholders in the main group.
Basically the calculation is (simplified)
$start = "{maingroup___hours_start};
$stop = "{maingroup___hours_stop};
$hours_worked = $stop - start;
This calculation is used in the main group and _also_ in the repeated groups.
It is re-calculated, I'm not using the results of a previous calculation - and the calculation works fine.
--------
The problem is that the ajax trigger that causes the calculation update is not firing when I add a repeated group.
The first repeated group works - when you select the start and stop time, the hours_worked is calculated and displayed in both the main group and the 1st repeated group - just fine.
But - when I add a repeated group, the hours_worked field is not re-calculated - it is blank. If I go back up to the main group, and change the start or stop times, then the calc runs in all displayed groups, but the calc does not run on add-group.
Thinking that I may need to force a re-calc, I added a required field in the repeated group as a "watched" field in the repeated group calculation. However, it is not triggering the calc either.
The weird thing is that this worked up till very recent changes to one of the forms (not to Joomla or Fabrik). It still works on my dev site.
Both are running 3.8.6 (joomla) and 3.8.1 (fabrik).
NOTE: On the working site, the calc field in the repeated group is a "child" of the calc field in the main group - though the underlying database field is different. In the non-working site, that was the same. Thinking that might be the problem, I broke the parent/child relationship so that the calc in the repeated group is independent. No help.
Thoughts?
-bg
The calculation is based on placeholders in the main group.
Basically the calculation is (simplified)
$start = "{maingroup___hours_start};
$stop = "{maingroup___hours_stop};
$hours_worked = $stop - start;
This calculation is used in the main group and _also_ in the repeated groups.
It is re-calculated, I'm not using the results of a previous calculation - and the calculation works fine.
--------
The problem is that the ajax trigger that causes the calculation update is not firing when I add a repeated group.
The first repeated group works - when you select the start and stop time, the hours_worked is calculated and displayed in both the main group and the 1st repeated group - just fine.
But - when I add a repeated group, the hours_worked field is not re-calculated - it is blank. If I go back up to the main group, and change the start or stop times, then the calc runs in all displayed groups, but the calc does not run on add-group.
Thinking that I may need to force a re-calc, I added a required field in the repeated group as a "watched" field in the repeated group calculation. However, it is not triggering the calc either.
The weird thing is that this worked up till very recent changes to one of the forms (not to Joomla or Fabrik). It still works on my dev site.
Both are running 3.8.6 (joomla) and 3.8.1 (fabrik).
NOTE: On the working site, the calc field in the repeated group is a "child" of the calc field in the main group - though the underlying database field is different. In the non-working site, that was the same. Thinking that might be the problem, I broke the parent/child relationship so that the calc in the repeated group is independent. No help.
Thoughts?
-bg