JavaScript gives you a way to validate input for several form elements at the same time and create relationships between them. Since you can use all of the operations and functions offered by JavaScript, you can make things as simple or complex as necessary.
Access to the form elements – and therefore to the input that users make into the form – is handled in JavaScript using the technical name of the respective form element.
Validations with the validate() function
All forms permit the definition of a validation script on each form page. Forms include a prepared validation function for this purpose, with the name validate(). This function is executed automatically when users switch to a different form page or submit the form.
Activating validation
In the page properties, a Validation area is provided for you to store your validation scripts.
If necessary, move the Validation slider to the right to activate the function.
Select the JavaScript option.
In the validation script field, define your validate() function with the necessary validation logic.
Access to form data
JavaScript makes it easy to access the data in your forms:
Form elements: Each element can be accessed using its associated variable, namely its technical name. For example, the element named email can be accessed by using the email variable.
Current form page: The current form page is also accessed using its corresponding variable, namely its technical name. This lets you carry out page-specific checks.