Sharing and Embedding Forms

Published forms can be shared with a public link or embedded directly in your own website. Visitors don't need a TemplateDocs account to fill in and submit a form.

Sharing Forms

When a workflow with a form trigger is published, its form becomes available at a public URL that you can share with anyone.

The URL is shown when publishing the workflow:

https://templatedocs.io/forms/<form_id>

Embedding Forms in Your Website

Published forms can also be embedded directly in your own website. Copy the embed code from the publish or Share dialog, or use the following snippet with your form's ID:

<div data-templatedocs-form="<form_id>" style="height:400px"></div>
<script src="https://templatedocs.io/embed.js" async></script>

Embed Options

The container element accepts the following attributes:

AttributeDescription
data-templatedocs-formThe form ID. Required.
data-templatedocs-dynamic-heightBy default, the form resizes to fit its content. Set to false to keep the form at the container's height instead of resizing it to fit the content.
data-templatedocs-headerSet to true to show the form's name and logo above the fields. Off by default.
data-templatedocs-titleThe accessible name of the embedded frame, announced by screen readers. Defaults to TemplateDocs form.

Reacting to Submissions

When a visitor submits an embedded form, a templatedocs:submitted event is emitted on the embedding container element and bubbles up the page. You can use it to show your own confirmation, redirect the visitor, or trigger other actions:

document.addEventListener("templatedocs:submitted", (event) => {
    console.log("Form submitted:", event.detail.formId);
});

Next Steps