Title: Calculate interdependent fields
Last modified: June 17, 2023

---

# Calculate interdependent fields

 *  Resolved [arr2020](https://wordpress.org/support/users/arr2020/)
 * (@arr2020)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/calculate-interdependent-fields/)
 * I am making an online calculator. This requires the user to input some common
   inputs say fieldname1. In addition to this, the user should either provide fieldname
   2 or fieldname 3. With fieldname 1 and fieldname 2, it is possible to compute
   fieldname 3. Similarly, With fieldname 1 and fieldname 3, it is possible to compute
   fieldname 2. I wish to provide two buttons, depending on which, form fields will
   be evaluated. For example, the “compute fieldname 3” button will clear fieldname
   3 and compute it using fieldname 1 and fieldname 2.
 * I need some pointers on how to write the required onclick events, and HTML content
   to be added, if any.
 * Thanks!

Viewing 1 replies (of 1 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/calculate-interdependent-fields/#post-16827402)
 * Hello [@arr2020](https://wordpress.org/support/users/arr2020/)
 * Thank you very much for using our plugin.
 * There is an easy solution.
 * You can disable the dynamic evaluation of the equations by unticking the “Dynamically
   evaluate the equations associated with the calculated fields” checkbox in the“
   Form Settings” tab ([https://resources.developers4web.com/cff/images/documentation/form-settings-tab.png](https://resources.developers4web.com/cff/images/documentation/form-settings-tab.png)),
   and then evaluate the equation you prefer from different buttons.
 * And then, insert the first button and enter the following piece of code as its
   onclick event: `EVALEQUATION('fieldname2');`
 * And finally, insert the second button, and enter the `EVALEQUATION('fieldname3');`
   code as its onclick event.
 * Best regards.

Viewing 1 replies (of 1 total)

The topic ‘Calculate interdependent fields’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/calculate-interdependent-fields/#post-16827402)
 * Status: resolved