Maxforms / Docs

Embed → Standard

Standard inline embed

Paste two lines of HTML into any page and your form appears inline, sized to fit its content.

1. The snippet

In the Maxforms app, click Share on any form, switch to the Embed tab, and copy the Standard snippet. It looks like this:

<script>
(function(w,d,u){w.Maxforms=w.Maxforms||function(){(w.Maxforms.q=w.Maxforms.q||[]).push(arguments)};if(d.querySelector('script[src="'+u+'"]'))return;var s=d.createElement('script');s.async=1;s.src=u;d.head.appendChild(s)})(window,document,'https://embed.maxforms.com/v1/embed.js');
</script>
<div data-maxforms-form="YOUR_FORM_CODE" data-maxforms-dynamic-height="1"></div>

The <script> block bootstraps our SDK. The <div> is where the iframe mounts. Paste once per page; you can include any number of <div data-maxforms-form> nodes after it.

2. Options

Add data attributes to the <div> to tweak appearance:

Attribute Value Effect
data-maxforms-dynamic-height1Iframe auto-resizes to content (default on).
data-maxforms-hide-title1Hide the form's title.
data-maxforms-align-left1Left-align (default is centered).
data-maxforms-transparent-background1Transparent iframe background.
data-maxforms-width100%Iframe width (when dynamic_height off).
data-maxforms-height500Iframe height in px (when dynamic_height off).

3. Pre-filling hidden fields

Declare a hidden field in your form (with a name like ref or utm_campaign). URL query parameters on the parent page with matching names will populate the hidden field automatically:

https://yoursite.com/landing?ref=launch&utm_campaign=spring

You can also set values explicitly via data-maxforms-field-* attributes:

<div data-maxforms-form="ABC123" data-maxforms-field-ref="launch" data-maxforms-field-source="banner-top"></div>

Undeclared parameters are ignored. Values are capped at 512 characters.

4. Multiple embeds on one page

Paste as many <div data-maxforms-form> elements as you want. Each gets a unique embedId (mf_1, mf_2, …) that's included in every event payload — useful when you want to route analytics by embed.