hub.eb?material_id=81&track_id=357

Validation Events


Validation Events are used to check the validity of data entered into a Field or Table Control.

When a page is submitted by a user the Validation Events are run for all Field and Table Controls:

  • that are editable (not hidden and not display only)
  • that appear before the Control that submitted the page
  • whose Field value has changed since the last validation

The Validation Events are run in the order of the Controls on the page.

A Validation Event is considered successful, i.e the input is valid, if no error message is issued.

Steps


1

Create a new Form. Add a Field Control and a Button Control to a page.

2

Create a new script, call it myValidation and add the following code:

event.owner.addErrorMessage('Validation failed');
3

Add the script to the Validation Event of your Field Control.

4

Save and run your Form. Enter some text into the Field Control. Nothing will happen until the page is submitted.

 

5

Click the button to submit your Form. The Validation Event will run when the Form is submitted. The Error message specified in myValidation will be shown.

Current Module

Related