Form Success Message

Issues related to forms.
Post Reply
Abelo
 
 
Posts: 21
Joined: Fri Jan 05, 2018 5:45 am
Location: Addis Ababa, Ethiopia

Form Success Message

Post by Abelo » Sun Oct 14, 2018 2:54 pm

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

User avatar
Pablo
 
Posts: 16891
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Form Success Message

Post by Pablo » Sun Oct 14, 2018 3:05 pm

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.

Abelo
 
 
Posts: 21
Joined: Fri Jan 05, 2018 5:45 am
Location: Addis Ababa, Ethiopia

Re: Form Success Message

Post by Abelo » Mon Oct 15, 2018 4:54 am

Ok thank you!

User avatar
ruel.lago22
 
 
Posts: 151
Joined: Thu Feb 01, 2018 11:32 am

Re: Form Success Message

Post by ruel.lago22 » Tue Jan 29, 2019 9:50 am

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 :(

User avatar
Pablo
 
Posts: 16891
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Form Success Message

Post by Pablo » Tue Jan 29, 2019 10:07 am

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

Post Reply