Are you getting double submitted leads or multiple leads with the same information? Would you like to ensure that someone isn’t able to submit your form twice in a row? Or perhaps only allow a single submission from any given browser session over the course or a period of time?
Cookies to the rescue!
This script will place a cookie in the browser upon form submission. You determine how long the cookie stays there for. While it’s there, the form will be disabled and a visitor coming from the same browser session will not be able to submit.
WORD OF WARNING: For certain use cases this script could be less than ideal. For example in cases when a computer is shared, if multiple people are needing to submit the form they won’t be able to without first clearing the cookie from the browser. Use with caution!
You can see this in action (built in Unbounce) here:
How to Install in Unbounce
Click Here for Instructions
WARNING: YOU ARE ENTERING DEVELOPER TERRITORY
Step 1. Add A Validation Field
Add a field to your form to use for validation with the cookie. This script uses the functionality of this workaround to validate the form submission. Make sure the field is visible (the script will hide it for you).
*If the cookie is present then the field will be filled with a value. The script uses a custom validation rule where that field must be empty in order for the form to submit.
The default ID for this validation field in the script is #already_submitted.
Step 2. Add the JS
Add the script from here:
Step 3. Edit the Script
Add the amount of minutes the cookie will last in the browser before expiring. This number will represent how long the form is disabled for after submission.
Add the ID of the validation field from step one.
Add the ID of the submit button
Add the error message to show if an attempt to double submit the form is made.
Step 4. Sit back and relax cause you’re done.
Want to take your Unbounce landing pages + Convertables™ to the next level?
Check out the Ultimate List of Unbounce Tips, Scripts & Hacks