Skip to main content

How does form validation work?

You have three options:

  1. You can set simple expressions for each control in the Custom Validation field in the Other tab.

    Form validation

    Read more on this here.

  2. Another option is to use JavaScript in Action Handlers. To do that, declare the following function:

    {
    validate: function (args /*{data, originalData, state, component, formName, index, controlRef, eventArgs, isChild}*/){
    var errors = {};
    // TODO: Insert your code for validation this form
    if (data.name == undefined || data.name == '') {
    errors.name = 'This field is required!';
    }
    if (errors.name) {
    throw {
    level: 1,
    message: 'Check errors on the form!',
    formerrors: errors
    };
    }
    return {};
    }
    }
  3. The third option is to use the server validation using triggers.