AI TOOLS

Embed a Typeform in a shared HTML page

A proposal, landing page or report with a Typeform survey on it. Why the embed shows nothing when you open the file from your computer, the height the inline form needs, what a wrong form ID shows, how to pass a hidden field, and how to share the page as a link.

4 min read·

Ask Claude or ChatGPT for a landing page, a proposal or a report "with a feedback form" and it often adds the Typeform embed code: a <div data-tf-widget="FORM_ID"> plus a script from embed.typeform.com. That code works in a shared page as written once the form ID and the height are right.

The tests below were run in headless Chrome against a public Typeform demo form, on a page served over http and on the same file opened from disk.

Blank when you open the file from your computer

Typeform's embed code loads its script from //embed.typeform.com/next/embed.js, an address with no https: in front. A page served from a web address fills that in. A file opened from your computer (a file:/// address) cannot.

Tested: the same page that showed the form over http showed nothing when opened from disk. Chrome logged ERR_INVALID_URL for the script and no form frame was added. Writing https://embed.typeform.com/next/embed.js fixes the local preview; uploading the page fixes it too, because the shared link is https.

Use your form ID

FORM_ID is the last part of your form's share link: for https://your-account.typeform.com/to/abc123 it is abc123. AI tools often fill in a placeholder.

Tested: an ID that does not exist loaded Typeform's own homepage inside the frame, with no error message. If your page shows Typeform's marketing site where the form should be, the ID is wrong.

The embed styles

All of these loaded the form in the test page with the same embed.js script:

  • ✓Inline: <div data-tf-widget="FORM_ID" style="width:100%;height:500px;"></div> puts the form in the page where the div is.
  • ✓Popup: <button data-tf-popup="FORM_ID">Give feedback</button> opens the form over the page when clicked. In a 1280 by 900 window it opened 1200 by 820.
  • ✓Slider: <button data-tf-slider="FORM_ID"> opens the form in a panel that slides in from the side, 800 pixels wide and the full window height in the test.
  • ✓A plain <iframe src="https://form.typeform.com/to/FORM_ID" width="100%" height="500"> also loaded, with no script.

Give the inline form a height

Typeform's code puts style="width:100%;height:500px;" on the div. AI tools sometimes drop it. Tested: without it, the form frame was 150 pixels tall, a strip that shows the first line of the question and cuts off the answers. With height:500px it was 500 pixels.

Pass a hidden field

To tell which page a response came from, add data-tf-hidden="source=proposal" to the div. Tested: the script added #source=proposal to the form address. The field must also exist as a hidden field in the form's settings in Typeform, or the value is not stored with the response.

Upload it and send the link

Drag the HTML file onto the FileShare Pro dashboard and copy the link. Viewers need no account. The shared view does not restrict scripts or frames inside your page, so the form loads there as it did in the test. Responses go to your Typeform account, not to FileShare Pro.

Edit the questions in Typeform and the embedded form shows the new version on the next load; the page and the link stay the same. To collect replies without a form service, see a feedback form with no backend. Related: a Calendly booking page in a shared page and a waitlist page.

Frequently asked

Do viewers need a Typeform account to answer?

No. A public Typeform can be answered by anyone who opens the page, the same as the form's own share link.

Does a password on the page keep the form private?

No. The password protects the page. The form ID is in the page source and the form works on its own at its Typeform address: password-protecting an HTML page.

Does the page show up in Google?

No. Shared files carry a noindex header: keeping a preview out of Google.

Got a page to share?

Drop the file, copy the link — live in seconds, free plan included.

Start sharing free