onWixFormSubmitted( )


Adds an event handler that runs when a site visitor submits a Wix Form and it is successfully received by the server.

When the site visitor submits a Wix Form, the field values are cleared and the onWixFormSubmitted() callback runs for the WixForms element.

The callback to run when the Wix Form is submitted is either the name of the function or a function expression.

The received WixFormSubmittedEvent object contains information about the Wix Form that was submitted. The WixFormSubmittedEvent object is returned by the callback asynchronously following verification of a successful submission, while the server starts to process the relevant actions.

onWixFormSubmitted() provides information and functionality available on the client side:

  • The function has access to the field names and field values on the form but does not have access to submission details that exist only on the server, such as the contact ID and the submission time.
  • The function performs operations only on the client side, such as displaying a message after submission.

For other Wix Forms events, see:

  • The onWixFormSubmit() event handler, which sets events that fire when a site visitor submits a Wix Form yet before it is sent to the server.
  • The onWixFormSubmittedError() event handler, which sets events that fire when a site visitor submits a Wix Form and it is not received by the server.
  • The onFormSubmit() event handler, which is called in the Backend section's code, to set events that fire on the backend when a site visitor submits a form.
Method Declaration
Copy
Method Parameters
eventHandlerfunctionRequired

eventHandler(event: WixFormSubmittedEvent): void The name of the function or the function expression to run when a Wix Form is submitted.

Was this helpful?
Yes
No