Required Fields
Last updated
Last updated
The next pro plugin feature is the capability of adding the required field of some calculator elements. In general, a required field is an input field on a form that must have a non-blank value to be valid before submitting a form.
The element with the required field comes with a red asterisk symbol () in the calculator form.
Calculator elements Checkbox, Radio button, Toggle button, Quantity, and Dropdown have the required field option that can be enabled in the element creation.
Checkbox, Radio button, and Toggle button elements need to be filled with options, if no option is chosen, a notification message will appear like "This field is required".
Checkbox, Radio button, Toggle button, File elements' examples with a notification message:
The Dropdown element required field will be shown if the user does not select any values. The Quantity element required field notification message will be shown if the quantity is zero ( 0 ).
Dropdown, Quantity elements' examples with a notification message:
The notification message content can be changed in the Calculator Settings: Settings > Notifications
The required field works only when the calculator form has the submit function. The calculator without the submit button will not work. Submitting a form function is available when you enable contact form or WooCommerce or Stripe or PayPal options in the Settings.
There has been created a sample calculator with elements that have the required field:
For each created element in this calculator contain the toggle button for enabling the required field option, you need to enable that option and save your work:
As the required field works only when there is the submit function in the calculator, after creating the desired calculator, you need to check the submit option in the Settings:
The main thing for the required field works properly is that there should be a submit button in the calculator:
Because after clicking the submit button, the required field does not allow non-chosen elements that have the required field is enabled.