> ## Documentation Index
> Fetch the complete documentation index at: https://docs.formbase.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Wix

> Use Formbase with Wix and Velo.

Wix forms are highly customizable, and with Velo you can send submissions to external endpoints like Formbase. This gives you full control over field names and success handling.

<Steps>
  <Step title="Create a Formbase endpoint">
    Create a new form in the Formbase dashboard and copy the endpoint URL.
  </Step>

  <Step title="Build your Wix form">
    Add input elements to your page and give them IDs (for example, `#nameInput`, `#emailInput`).
  </Step>

  <Step title="Send the submission with Velo">
    ```js theme={null}
    $w.onReady(function () {
      $w('#submitButton').onClick(async () => {
        const payload = {
          name: $w('#nameInput').value,
          email: $w('#emailInput').value,
        };

        const response = await fetch('https://formbase.dev/s/YOUR_FORM_ID', {
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify(payload),
          redirect: 'manual',
        });

        if (response.status === 303 || response.ok) {
          $w('#status').text = 'Submitted!';
        } else {
          $w('#status').text = 'Submission failed.';
        }
      });
    });
    ```

    Create a text element with ID `#status` for feedback.
  </Step>
</Steps>

<Callout type="note">
  For file uploads, use `FormData` and a file input element instead of JSON.
</Callout>
