• Resolved arr2020

    (@arr2020)


    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

    (@codepeople)

    Hello @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), 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.