Troubleshooting: Embedding Issues
Fix problems when embedding FormRobin forms on your website. FormRobin uses a simple div + script embed code — not a manual iframe tag. The script automatically creates and manages the iframe for you.
How FormRobin Embedding Works
When you embed a FormRobin form, you paste a snippet like this into your website's HTML:
<div class="formrobin-embed" data-path="/f/your-form-slug"></div>
<script src="https://formrobin.com/js/embed.js"></script>
The embed.js script automatically:
- Creates an iframe and replaces the
<div>element - Sets the iframe source to your form's URL
- Uses the iframe-resizer library to auto-adjust the iframe height as content changes (minimum height: 500px)
- Handles scrolling back to the top of the form when users navigate between pages
You do not need to write or modify any iframe tag yourself.
Common Embedding Problems
- Form doesn't appear on the page
- Form appears but is cut off or the wrong size
- Form works at its direct URL but not when embedded
- Browser console shows security errors
Issue: Incorrect or Modified Embed Code
Solution:
- Get a fresh embed code from FormRobin (click Share on your form, then copy the Embed code)
- Copy the entire snippet — both the
<div>tag and the<script>tag - Do not modify the
data-pathattribute or the scriptsrcURL - Paste the snippet exactly where you want the form to appear in your page's HTML
Common mistakes:
- Copying only the
<div>without the<script>tag — the form won't load - Changing the
data-pathvalue — the form URL will break - Placing the snippet inside an element that hides overflow or has
display: none
Issue: Form Cut Off or Wrong Size
FormRobin's embed script uses the iframe-resizer library to automatically adjust the iframe height based on the form's content. You should not need to set height manually.
If the form still appears cut off:
- Check that no parent CSS is restricting the container's height (e.g.,
max-height,overflow: hidden) - Ensure the
<div class="formrobin-embed">container is not inside a fixed-height element - Remove any custom CSS targeting the FormRobin iframe
- Test on both mobile and desktop — the iframe width is set to 100% automatically
Note: The iframe starts at 700px tall and auto-resizes with a minimum height of 500px. If your form is very short, some empty space below the form is expected.
Issue: Content Security Policy (CSP) Blocking
Symptoms: Browser console shows "Refused to frame" or other CSP errors, and the form does not load.
Because embed.js creates an iframe pointing to formrobin.com, your site's Content Security Policy must allow framing from that domain.
Solution:
- Add
formrobin.comto your CSPframe-srcdirective - Also add it to
script-srcso the embed script can load - Example header:
Content-Security-Policy: frame-src 'self' formrobin.com; script-src 'self' formrobin.com; - Contact your website administrator or hosting provider if you are unsure how to update CSP headers
Issue: Mixed Content (HTTP/HTTPS)
Symptoms: Form does not load, and the browser console shows a mixed-content warning.
Solution:
- FormRobin embed URLs always use
https://— do not change them tohttp:// - If your own site is served over HTTP, modern browsers may block the HTTPS iframe — switch your site to HTTPS
- Check that no proxy or CDN is rewriting the embed script URL to HTTP
Issue: Browser Cache Showing Old Version
Solution:
- Hard refresh: Ctrl+F5 (Windows) or Cmd+Shift+R (Mac)
- Clear your browser cache
- Test in an incognito or private window
- Try a different browser
Issue: Multiple Forms on One Page
You can embed more than one FormRobin form on a single page. Each form needs its own <div class="formrobin-embed"> element with its own data-path, but you only need to include the <script> tag once.
<div class="formrobin-embed" data-path="/f/first-form"></div>
<div class="formrobin-embed" data-path="/f/second-form"></div>
<script src="https://formrobin.com/js/embed.js"></script>
Note on Domain Restrictions
Good news: FormRobin forms can be embedded on any website without domain restrictions. You don't need to whitelist or configure domains — simply copy the embed code and paste it into your site.
FAQ
Q: Do I need to write my own iframe tag?
A: No. The embed code is a <div> + <script> snippet. The script creates and manages the iframe automatically.
Q: How do I control the form's height?
A: You don't need to. The iframe-resizer library automatically adjusts the height to match the form content. If something looks off, check that no parent CSS is restricting the container size.
Q: Can I style the embedded form?
A: Use FormRobin's built-in Form Styling options (colors, fonts, background) inside the form editor. Custom CSS applied from your website cannot reach inside the iframe due to browser security restrictions.
Still having embedding issues? Contact support with your website URL and the embed code you're using!