Last active
January 4, 2024 19:14
-
-
Save acoyfellow/0ecf77ce624888de9964d0aa0c74949f to your computer and use it in GitHub Desktop.
Prevent duplicate form submissions in Phonesites.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// Add to Custom Code > Bottom of Body | |
try{ | |
if(localStorage.getItem("lead_id")){ | |
setError("Only one submission allowed."); | |
throw new Error(); | |
}; | |
} catch(e){ | |
console.error(e); | |
}; | |
window.beforePost= function(){ | |
try{ | |
if(localStorage.getItem("lead_id") || store.submitCount > 1){ | |
store.preventPost= true; | |
window.location.reload(); | |
}; | |
}catch(e){ | |
console.error(e); | |
}; | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment