Hey I saw my post was linked so I’ll try and sum up what I did to get around this.
It this article Forms setup | Netlify Docs it says you can redirect to a custom page on form submit. I simply redirected to a page called “success” and had a meta refresh tag that redirected again to a hashed url.
Then in javascript, on the page that I needed the content on, I used this:
<script type="text/javascript">
// Get URL
var url = window.location.href;
// Get DIV
var msg = document.getElementById('success');
// Check if URL contains the keyword
if( url.search( 'success' ) > 0 ) {
// Display the message
msg.style.display = "block";
}
</script>
This script basically looks for #success in the url and if it finds it changes the style of an element.
In your case you wanted a modal or an overlay so this can easily be done by adding the modal ID into this script.
Yes, this is an example of what I was looking for, but what I’m not sure is how you refresh the page with the meta tag. Does this happen right after the user clicks the submit button on the form? Or is it refreshing the page every certain amount of time?
I’ll attach an example of the meta refresh tag I use. Just add this to the sucess.html for whatever page you have set for the form to take the user to then refresh it to a page with parameters in the url.