Add email validation to Unbounce forms
In Unbounce, open the Javascripts panel in the page builder, add the widget script and the short attach script, and place them before the closing body tag. The checks run on your landing page's own form.
Before you start
Custom JavaScript is available in the page builder on Unbounce plans; check yours if you do not see the Javascripts panel.
Setup
- Open your page in the Unbounce builder and click Javascripts at the bottom of the left panel.
- Choose Add New Script, name it SimpleVerifier and set the placement to Before Body End Tag.
- Paste the snippet below, save, and publish the page.
- Open the published page (not the editor preview) and type jane@gmial.com into the field. You should see a suggestion to use gmail.com under it. Try x@mailinator.com to see the disposable-address error.
<script src="https://simpleverifier.com/widget.js" defer></script>
<script>
// Turns the widget on for every email field on the page, including fields the builder adds later.
function svAttachAll() {
if (!window.SimpleVerifier) return;
document.querySelectorAll('input[type="email"]').forEach(function (input) {
SimpleVerifier.attach(input);
});
}
document.addEventListener("DOMContentLoaded", function () {
svAttachAll();
new MutationObserver(svAttachAll).observe(document.body, { childList: true, subtree: true });
});
</script>Limits on Unbounce
- Unbounce lead forms can be built with its own form element or a dropped-in pop-up. The snippet watches for added fields, but test the pop-up form separately.
- It does not run in the builder, only on the published page or preview URL.
- Blocking a submit relies on the browser's own form validation. If a builder sends the form with its own script instead, the hint under the field still appears but the form may go through, so test on the published page.
Check that the mailbox exists
The widget checks format, typos, throwaway domains and role addresses in the browser. It cannot tell whether a mailbox exists, because that needs an API key and anything in a web page can be read by visitors. For that, call the API from the server that receives the form. See the API docs, the full form widget page with Node, PHP and Python examples, and pricing.
Common questions
- Will it slow my landing page?
- The widget is one small file with no dependencies, loaded with defer, so it does not block the page from rendering.
- Does it send the email address to SimpleVerifier?
- No. Every check runs in the browser against lists inside the script. Nothing is sent to us or to anyone else.
- Can I also check the lead after submission?
- Yes. Send the lead to Zapier or Make and call the verify endpoint there, or call it from your own backend.
- Is the form widget free?
- Yes. The widget runs in the visitor's browser, needs no account or API key and has no usage limit. Checks that confirm the mailbox exists use the SimpleVerifier API from a server, which comes with Pro, Business and Agency, from $39/month.