Since v2.12, it is possible to have different calculations (or calculation routines) in a single element. This feature adds a more convenient way to handle multiple calculations. Before, the plugin was only able to handle multiple calculations in separate elements which might be overwhelming in a large form.
As of the latest version, calculation routines have been added with a more modular approach. For example, you can enable certain calculation parts depending on a checkbox’s choice. The new calculation routines look like this in the backend:
This element has 3 calculation routines. You can add more calculation routines by clicking the “add calculation routine” button.
The first calculation routine adds 10 to the value, the second one 20 and the third one subtracts 10. Note that you can give names to all calculation routines so you’re able to group them. This would come in handy if multiple calculation routines should be enabled or disabled.
In order to enable or disable calculation routines, select “enable calc routine (name)” or “enable calc routine (index)” in the conditional section. Enter the name or the index number in the TV field.
The first conditional row activates all calculation routines with the name “add”, whereas the second conditional row activates all calculation routines with the name “subtract”.
Once a condition is true, the assigned calculation routines will be activated. As soon as the same condition is not true anymore, the calculation routines will be deactivated automatically.
In the following example, the first checkbox activates calculation routine #1 (+10) and #2 (+20), the second checkbox activates calculation routine #3 (-10).