Preparing to Use Validation

To use validation, you must make sure the form_validator object is defined.

To prepare to use validation

  1. Use a JavaScript editor to open the forms.js file.

  2. Make sure the form_validator object is defined.

    To use validation, the forms.js file must include the following code near the start of the JavaScript function for that form:

    var validator = new
    form_helpers.form_validator(ctx.session, ctx.form);
    

    This code creates a form_validator object that you can use through the validator variable.