Page 1 of 1

Form Success Message

Posted: Sun Oct 14, 2018 2:54 pm
by Abelo
Hi there is there a way to just show a pop up success/Error msg when clicking submit button instead of taking the user to a different success/Error page? If so please explain how

Re: Form Success Message

Posted: Sun Oct 14, 2018 3:05 pm
by Pablo
There is no standard solution for this because PHP cannot trigger a popup directly.
But you can use events (onsubmit) to submit the form and then trigger a popup.

Re: Form Success Message

Posted: Mon Oct 15, 2018 4:54 am
by Abelo
Ok thank you!

Re: Form Success Message

Posted: Tue Jan 29, 2019 9:50 am
by ruel.lago22
Pablo wrote: Sun Oct 14, 2018 3:05 pm But you can use events (onsubmit) to submit the form and then trigger a popup.
I don't find "onsubmit" in the events option. Plus it's impossible to trigger a popup because it will take you to the success/error page after submission or if no redirection set, it will just show you a blank page with the same URL. I was hoping to trigger next page on my carousel form after submission but it seems not to work :(

Re: Form Success Message

Posted: Tue Jan 29, 2019 10:07 am
by Pablo
The onsubmit event is in the form's even list.

To display a popup you will have have to write a function that submits the form and then displays a popup.
https://blog.teamtreehouse.com/create-ajax-contact-form