> For the complete documentation index, see [llms.txt](https://help.distro.so/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.distro.so/routing-forms/custom-html-form.md).

# Custom HTML forms

Connect a standard HTML form to a Form Router with the router's installation script.

## Identify the form and fields

Inspect the form in your browser's developer tools. Use a stable form ID, such as `<form id="contact-form">`, and enter `#contact-form` as its **Form selector** in Distro.

For each field, copy the HTML `name` attribute rather than its visible label. For example, `<input name="work_email">` uses `work_email` in the mapping. Include the prospect's email and fields needed by your rules.

Create the mapping under **Form routing → Forms**, then select it in the router's **Form Submission → Connected form**. See [Forms](/routing-forms/overview.md) for manual mapping and **Auto map**.

## Install the script

Open **Install Router**, choose **After a form → popup** and **Custom HTML / website builder**, then copy the code. A typical popup installation looks like this; replace both placeholders with your router and form selector:

```html
<script src="https://app.distro.so/inbound.js"></script>
<script>
  window.distro = new Distro({ routerId: 'YOUR_ROUTER_ID' });
  distro.schedule('#contact-form');
</script>
```

For an embedded scheduler, choose **After a form → embedded** and place the provided `#scheduler-container` where scheduling should appear. For custom application submissions, choose **Button / in-app** and call `bookDemo(fields)` with real mapped values after validation; the scheduler opens only when `submit` returns a qualified session.

Place the script after the form or before `</body>`. Load the library before initializing `Distro`.

The standard-form handler intercepts submission, sends the form values to Distro, and attempts a JSON POST to the form's original action. If your form relies on another JavaScript handler, a redirect, or a non-JSON endpoint, check that integration explicitly; do not assume the original submission is unchanged.

Test the published page after [activating the router](/routing/router-versions.md). Confirm the original form destination, qualified booking experience, and disqualification behavior. Check **Routing Logs** for the submitted values.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.distro.so/routing-forms/custom-html-form.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
