Common Ninja offers a variety of form fields to suit your needs.
Whether you’d like to add a signature to your form, file upload, images, selection field and so much more, Common Ninja’s forms widgets have you covered.
One such field is the 'Formula' field, which was designed to allow users to create mathematical value using another form field. This enables users to use a couple of fields that will calculate the mathematical equation added and display the needed value.
In this guide, we'll walk you through how to access and utilize the 'Formula' field:
- Access your form editor and navigate to the 'Content' tab, then proceed to the 'Fields' section.
- Within the 'Form Fields' section, click the 'Add a Field' button to add fields to your form.
- In the newly opened item settings, go to the 'Form Element' setting to select your desired field type. Choose the 'Formula' field from the available options.
- Selecting the 'Formula' field will open its settings, allowing you to define your mathematical operations and specify the source field from which you'd like to obtain your numerical values. Click 'Add Operation' to create a new mathematical equation.
- The operator functionality enables you to combine two numbers, along with the ability to add, subtract, multiply, or divide these numbers using the "Operation" setting.
- There are three methods for providing the two values on which the operation will be applied:
a. Fixed Number: This option allows you to specify a number of your choice to be included in the operation.
b. Field Value: This option allows you to use a number inputted by the user. The number entered in the number field is used as part of the mathematical equation.
Note that this method can only draw numbers from the "Number" field:
c. Operation Value: Consider a scenario where you have created an operation that uses the following parameters:
This operator multiplies a fixed number: 10, in this example, by a field value entered by the user, which we’ll call the "Item Amount" in this example.
If you need to add another number to this equation, you can achieve this by using the "Operation Value" feature.
After defining an operator, create another operator, specify the number you want to add in "Value 1," select the "Operation Value" option for "Value 2” and choose the required operator.
And that’s it! You have successfully added the 'Formula' field to your form.