For anyone like me who wants an AJAX form submission here was my solution…
Since refreshing a page on submission of a form shouldn’t be happening in 2023 – and anyone submitting a form would lose their place on the site – I needed to find a work around.
I didn’t want to have to hard code an AJAX form (that’s beyond my level of expertise) but I realized that since I use Contact Forms 7 for my general forms and that Newsletter integrates with CF7 allowing you to collect email addresses from form submissions, I simply made a Newsletter sign up form using CF7. I can style it like my other forms. The basics of the CF7 form look like this:
Your email
[email* your-email autocomplete:email]
[response]
[submit "Sign Up!"]
Put that in the Edit Contact Form window. Then change the response messages.
The [email] part is from Newsletter’s integration.
[response] puts the ‘Thanks for signing up!’ above the submit button.
Obviously, you can put in first, last name, etc.
It will validate real email addresses and allow for an opt in checkbox as well. I have it sending messages to wordpress@[mysite.com] which isn’t a real address, that way I don’t get emails with every sign up.
Then, using the CF7 integration with Newsletter, connect the fields with your form.
Hope that helps someone.