validate( )


Deprecated

This method is deprecated.

Deprecated. This method will be deprecated on March 30, 2026. Replace with getForm().

Migration Instructions

To stay compatible with future changes, migrate to getForm(). The validation is now performed under the hood by the getForm() method.

To migrate to the new method:

  1. Add a backend file to your site.

  2. Write a code so that it replaces the validate() method from the frontend with the getForm() method from the backend. Export your backend function so that it can be used in the frontend.

  3. Import your backend function into the frontend file. Test your changes to make sure your code behaves as expected.

The validate() method returns a Promise that resolves to {valid: true} if the fields and values in the registration form are valid or rejects if there are invalid fields or values.

When validate() is called, validateInput() also runs for all your form fields.

The following are invalid when checked against the event's registration form as defined in the site dashboard:

  • The specified form values contain a field that doesn't exist in the event's registration form.
  • The specified form values are missing a field that exists in the event's registration form. You must also include non-required fields even if their values are empty.

Note: The frontend Events APIs aren't functional when previewing a site. View a published version of a site to see their complete functionality.

Method Declaration
Copy
Method Parameters
formValuesArray<FormValue>Required

Field names and values for a registration form.

Returns
Return Type:Promise<ValidationResult>
Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?