> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Method name: onWixFormSubmittedError(eventHandler: WixFormSubmittedErrorEventHandler)

# Method package: w

# Method menu location: w --> WixForms --> onWixFormSubmittedError

# Method Link: https://dev.wix.com/docs/velo/velo-only-apis/$w/wix-forms/on-wix-form-submitted-error.md

# Method Description:

Adds an event handler that runs when a site visitor is not able to successfully submit a Wix Form to the server.

If a Wix Form has not been successfully submitted by the site visitor, the received
 [`WixFormSubmittedErrorEvent`](#WixFormSubmittedErrorEvent) object
 contains error information about why the Wix Form could not be submitted. 

 The `WixFormSubmittedErrorEvent` object is returned by the callback asynchronously right after 
 an unsuccessful submission.

 The `onWixFormSubmittedError` error handler runs for for the [`WixForms`](https://dev.wix.com/docs/velo/api-reference/$w/wix-forms/introduction.md) element. The callback to 
 run when a submission error occurs is either the name of the function or a function expression.
 

 **Error Codes and Descriptions**


 * INVALID_FIELD. A field value was not entered correctly by the site visitor.
 * FILE\_NOT\_UPLOADED. A file or signature upload did not succeed.
 * INVALID_ARGUMENT. An internal server error occurred.
 * UNAUTHENTICATED. The site member's or visitor's identity was not authenticated.
 * PERMISSION_DENIED. The site visitor does not have permissions to submit the Wix Form. For example, a reCAPTCHA challenge was not verified.
 * RESOURCE_EXHAUSTED. The request to submit the Wix Form was denied by the server to prevent overload and improve overall performance.
 * UNAVAILABLE. The service is not available.
 * UNKNOWN_ERROR. An unknown error occurred.




 For other Wix Forms events, see: 

 + The [`onWixFormSubmit()`](#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 [`onWixFormSubmitted()`](#onWixFormSubmitted) event handler, which sets events that fire when a site visitor submits a Wix Form and it is successfully received by the server. 
 + The [`onFormSubmit()`](https://dev.wix.com/docs/velo/apis/wix-crm-backend/events/on-form-submit.md) 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 Code Examples:

*** Note: do not assume any prop names or enum values other than the ones in the example.

## An event that is fired on a WixForms element when the Wix Form is not submitted successfully

```javascript
$w("#myWixForms").onWixFormSubmittedError(     
  (  {code, message}  ) => {
    $w("#errorCodeText").text = code;
    $w("#errorMessageText").text = message;
  });
```

---