Form Embed Options: iframe, Script, and Popup
Embed Instaform forms using iframe, inline script, or popup modal. Configure position, button text, colors, and choose the right method for your website.
Building a great form is half the job. The other half is putting it where people will actually fill it out. A form sitting in your Instaform dashboard doesn't collect submissions — it needs to live on your website, your landing page, your app, or wherever your audience spends time.
Instaform offers three embed methods, each designed for a different context: iframe for standard embedding, script tag for inline embedding, and popup for modal overlays. Here's how each one works, when to use it, and how to configure it.
iframe Embed
The iframe embed is the most straightforward method. You copy a snippet of HTML, paste it into your website's code, and the form appears in a self-contained frame.
How It Works
An iframe creates a window within your page that loads the form from Instaform's servers. The form renders inside this window with its own styles, scripts, and behavior, completely isolated from your page's code. Your website's CSS doesn't affect the form, and the form's CSS doesn't affect your website.
The embed code looks like a standard HTML iframe tag with your form's unique URL as the source. You paste it into any HTML page, CMS content block, or website builder that accepts custom HTML.
When to Use iframe
CMS platforms. WordPress, Squarespace, Wix, Webflow, and most website builders accept iframe embeds. If you're using a CMS, iframe is usually the path of least resistance.
When style isolation matters. Because iframes are sandboxed, your website's CSS can't accidentally break the form's layout, and the form can't interfere with your page. This isolation is valuable when your website has complex or aggressive CSS that might conflict with embedded content.
When you want zero JavaScript. iframes are pure HTML. No JavaScript runs on your page. If you have strict content security policies or want to minimize scripts, iframe embeds are the cleanest option.
Configuration
The main thing to configure is the iframe's dimensions. Set the width to match your content area — typically 100% to fill the available space. Set the height to accommodate the form's length. If the height is too short, the form will have its own scrollbar inside the iframe. If it's too tall, you'll have empty space below the form.
For responsive websites, set the width to 100% and use a reasonable height. Most forms work well at 600-800px height, but forms with many fields or conditional logic that reveals additional sections might need more.
Limitations
iframes have a fixed height, so if your form's length changes dynamically — due to conditional logic showing/hiding fields — the iframe might show scrollbars or have extra whitespace. The script tag embed handles this better.
iframes can also look slightly different across browsers and devices. The border, scrollbar style, and rendering can vary. Setting border: none on the iframe and testing across browsers catches most visual inconsistencies.
Script Tag Embed (Inline)
The script tag embed injects the form directly into your page's DOM. Instead of loading in an isolated frame, the form becomes part of your page — sitting alongside your headers, paragraphs, and images as if you built it there.
How It Works
You paste a small JavaScript snippet into your page. When the page loads, the script creates the form elements directly in your page's HTML at the location where you placed the snippet. The form's styles are scoped to avoid conflicts with your page, but the form is genuinely part of your page's document structure.
When to Use Script Tag
When you need dynamic height. Because the form is part of your page's DOM, its height adjusts naturally as content changes. If conditional logic reveals five new fields, the page grows. If a section collapses, the page shrinks. No scrollbars, no whitespace, no height calculations.
When you want seamless visual integration. An inline form feels more native than an iframe. There's no subtle frame boundary, no potential for double scrollbars, no visual gap between the form and the surrounding content. The form flows with the page.
When you need page interaction. Because the form is in the page's DOM, it can interact with the page's JavaScript if needed. URL parameters can pre-fill form fields. Page-level analytics can track form interactions. Custom scripts can respond to form events.
Configuration
Place the script snippet where you want the form to appear. In a WordPress page, use a Custom HTML block. In a landing page builder, use an HTML section. In raw HTML, paste it inside a container div.
The form automatically takes the width of its parent container, so control the width by controlling the container. A form inside a max-width: 600px centered div will be 600px wide. A form inside a full-width section will stretch edge to edge.
Considerations
Script embeds run JavaScript on your page, which means they're subject to your page's content security policies. If your website blocks inline scripts or external script sources, you'll need to whitelist Instaform's domain.
Script embeds can also, in rare cases, have style conflicts with very aggressive CSS resets or frameworks on your page. If your site uses a CSS framework that sets global styles on all inputs, buttons, or forms, those styles might bleed into the embedded form. Testing on your actual page (not just a blank test page) catches these issues.
Popup Embed (Modal)
The popup embed displays your form as a modal overlay triggered by a button click. The form isn't visible on the page initially — a floating button appears, and clicking it opens the form in a centered or corner-positioned modal.
How It Works
You paste a snippet that creates a trigger button on your page. The button floats in a fixed position — typically a corner of the viewport. When a visitor clicks the button, the form slides in or fades in as a modal overlay, dimming the background. The visitor fills out the form, submits it, and the modal closes, returning them to the page.
When to Use Popup
When the form isn't the page's primary content. If the page is a blog post, a product page, or a landing page where the main content isn't the form, a popup keeps the form available without dominating the layout. Visitors who want the form can access it. Visitors who don't can ignore it.
For feedback and support. A persistent "Feedback" or "Help" button in the corner of every page lets visitors access a feedback form or support ticket form from anywhere on your site. It's always available without always being visible.
For lead capture on content pages. A blog post about your industry might convert visitors into leads, but embedding a full form in the middle of the article disrupts the reading experience. A popup triggered by a corner button offers conversion without interruption.
For multi-page forms on single-page sites. If your website is a single-page site (common for portfolios, events, and small businesses), a popup form avoids awkward scrolling to a contact section. The button is always visible, regardless of where the visitor is on the page.
Position Options
The popup button can be positioned in four locations:
Bottom-right is the most common and expected position. It's where live chat widgets typically sit, so visitors are conditioned to look there for help and contact options. This is the default and the recommended choice for most use cases.
Bottom-left is the alternative when bottom-right is occupied — maybe you already have a live chat widget there. Bottom-left is visible and accessible without conflicting with other floating elements.
Top-right is uncommon but useful for announcements or surveys where you want higher visibility. A top-positioned button is more likely to be noticed immediately, which can be good for time-limited surveys or urgent feedback requests.
Top-left is the least common position. It can work for left-to-right reading languages where the eye naturally starts at the top-left, but most users aren't conditioned to find interactive elements there.
Customizing the Button
The popup trigger button is customizable in two ways.
Button text controls what the button says. "Contact Us" for lead forms. "Feedback" for survey forms. "Get Help" for support forms. "Register Now" for event registrations. Keep it short — two to three words maximum. The button needs to be readable at small sizes on mobile devices.
Button color controls the button's background color. Match it to your brand's primary color for consistency, or use a contrasting color to make it stand out against your page's design. A bright button on a muted page draws attention. A muted button on a bright page blends in until the visitor is ready to look for it.
The modal itself inherits your form's custom theme, so the colors, fonts, and styling you've configured for the form apply when it opens. The button brings them in; the theme welcomes them.
Choosing the Right Method
The decision tree is straightforward.
Is the form the main purpose of the page? Use script tag (inline) embed. The form is front and center, dynamically sized, and visually integrated.
Is the form one element among many on the page? Use iframe embed. It's simple to implement, isolated from page styles, and works across all platforms.
Should the form be available but not immediately visible? Use popup embed. The trigger button provides access without consuming layout space.
Combining Methods
You're not limited to one method. A website might use script tag embedding for the Contact page (where the form is the page's purpose), iframe embedding for a blog sidebar widget (where the form is supplementary), and popup embedding on product pages (where the form should be available but not dominant).
Each page has different priorities, and each embed method serves different priorities. Match the method to the context.
Technical Considerations
Performance
iframe embeds are the lightest on your page — they load the form in a separate context that doesn't compete with your page's rendering. Script embeds add JavaScript execution to your page load, though the impact is minimal. Popup embeds load the form on trigger rather than on page load, meaning they have zero performance impact until the button is clicked.
Mobile Responsiveness
All three embed methods are responsive. iframes scale with their container width. Script embeds adapt to their parent element. Popups display as full-screen modals on mobile devices, providing a focused, distraction-free form experience on small screens.
SEO
Script tag (inline) embeds place the form content in your page's DOM, which means search engines can see the form fields — potentially beneficial for pages where the form is the primary call to action. iframes and popups keep form content out of the page's DOM, which is neutral for SEO.
Multiple Forms
You can embed multiple forms on the same page using any combination of methods. Two inline forms in different sections. An iframe in the sidebar and a popup in the corner. An inline lead form in the hero section and a popup feedback form in the footer. Each form operates independently.
Getting Started
Building your form in the drag-and-drop builder, applying your brand theme, and embedding it on your site is a workflow that takes minutes from start to finish. The embed options are available in the form's settings panel once your form is ready to publish.
Pick the method that matches your page. Paste the code. Your form is live.
Ready to try Instaform?
Join the waitlist and be the first to build forms that actually work for your business.