MobyformMobyform Docs
MobyformMobyform Docs
Homepage

Getting Started

Getting StartedCreate a FormForm Editor

Form Configuration

Field TypesConditional LogicForm SettingsTheme Customization

Publishing & Data

Publishing & SharingData Management

Features

Exams & AssessmentsTemplatesTeam CollaborationOrder FormsIntegrations

Advanced

Advanced

Guides

Guides

FAQ

FAQ

How to Embed Forms in Your Website

Embed Mobyform forms into your website, blog, or application.

How to Embed Forms in Your Website

Mobyform supports multiple ways to embed forms into your website, so users can fill them out without leaving your site.

Embedding Options Overview

MethodDescriptionBest For
iframe EmbedEmbed the form inline on a pageMost common; works with any website
Popup EmbedForm appears in a popup on button clickSaves page space; great for feedback
Full-Page EmbedForm fills the entire pageDedicated form pages

iframe Embed

Get the Embed Code

  1. Open the form's "Publish" page
  2. Select the "Embed" option
  3. Copy the iframe code

Example Embed Code

<iframe
  src="https://your-domain.com/s/your-form-key"
  width="100%"
  height="600"
  frameborder="0"
  style="border: none;"
></iframe>

Auto-Adjusting Height

To make the form height adapt to content:

<iframe
  src="https://your-domain.com/s/your-form-key"
  width="100%"
  frameborder="0"
  style="border: none; min-height: 500px;"
  scrolling="auto"
></iframe>

Platform-Specific Instructions

WordPress

  1. In the post or page editor, add a "Custom HTML" block
  2. Paste the iframe code
  3. Preview and publish

React / Next.js

function FormEmbed() {
  return (
    <iframe
      src="https://your-domain.com/s/your-form-key"
      width="100%"
      height="600"
      frameBorder="0"
      style={{ border: 'none' }}
    />
  );
}

Vue

<template>
  <iframe
    src="https://your-domain.com/s/your-form-key"
    width="100%"
    height="600"
    frameborder="0"
    style="border: none"
  />
</template>

Static HTML

Paste the iframe code directly into your HTML file where you want the form to appear.

Popup Embed

How to Use

Popup embed is ideal for showing a form when a user clicks a button or link:

<!-- Trigger Button -->
<button onclick="openForm()">Open Feedback Form</button>

<!-- Modal Container -->
<div id="form-modal" style="display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.5); z-index:9999;">
  <div style="position:relative; width:90%; max-width:700px; height:80%; margin:5% auto; background:#fff; border-radius:8px; overflow:hidden;">
    <button onclick="closeForm()" style="position:absolute; top:10px; right:10px; z-index:1; cursor:pointer;">✕</button>
    <iframe src="https://your-domain.com/s/your-form-key" width="100%" height="100%" frameborder="0" style="border:none;"></iframe>
  </div>
</div>

<script>
function openForm() {
  document.getElementById('form-modal').style.display = 'block';
}
function closeForm() {
  document.getElementById('form-modal').style.display = 'none';
}
</script>

Embed Settings

Pre-Fill Fields via URL Parameters

You can pre-populate form fields by adding URL parameters:

https://your-domain.com/s/your-form-key?field_name=John&field_email=john@example.com

Use cases:

  • Pre-fill email from an email campaign link
  • Pass product name from a product page
  • Forward customer info from a CRM

Custom Styling

For more precise style control:

  1. Adjust styles in the form's "Theme" settings
  2. Pro plans support custom CSS injection
  3. Match the form style to your website's overall design

Important Notes

  • HTTPS required — The embedding page should use HTTPS to prevent browsers from blocking the form
  • Cross-origin isolation — The iframe form is isolated from the parent page and cannot communicate directly
  • Mobile responsiveness — iframes on mobile may need additional responsive handling
  • Load time — First load takes a moment; consider adding a loading indicator

Common Issues

The form doesn't display fully in the iframe?

Check that the iframe height attribute is large enough — set it to at least 600px or use percentage height.

The form won't submit after embedding?

Check for cross-origin restrictions and ensure the form URL uses HTTPS.

How do I redirect after form submission?

In "Form Settings" → "Submission Settings", set a "Redirect URL" — the form will automatically navigate to your specified URL after submission.

Related Docs

  • Publishing & Sharing — More sharing options
  • Custom Domains — Use your own domain
  • Theme Customization — Adjust form styling

Table of Contents

How to Embed Forms in Your Website
Embedding Options Overview
iframe Embed
Get the Embed Code
Example Embed Code
Auto-Adjusting Height
Platform-Specific Instructions
WordPress
React / Next.js
Vue
Static HTML
Popup Embed
How to Use
Embed Settings
Pre-Fill Fields via URL Parameters
Custom Styling
Important Notes
Common Issues
The form doesn't display fully in the iframe?
The form won't submit after embedding?
How do I redirect after form submission?
Related Docs