Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Process form in modular page

Started by Muut Archive 9 years ago · 1 replies · 386 views
9 years ago

Hi everybody,

I'm trying to set up a contact form in a modular page and I want to either replace the <form> with a <div> including the form.message or display a popup on submit to let the user know that the mail is sent successfully without redirecting to another page.
Is it possible and what is the best way to achieve this? Is it necessary to create a custom plugin for onFormProcess?

Thanks in advance.

9 years ago

You can intercept the form submit using JavaScript, and send the form using AJAX to the server, and when the result comes back, display the message.

This is doable but there is no example or "standard way" yet. The default is to display the message in another page.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1338 9 years ago
Archive · by Muut Archive, 9 years ago
2 927 9 years ago
Archive · by Muut Archive, 9 years ago
2 4056 9 years ago
Archive · by Muut Archive, 9 years ago
1 2941 9 years ago
Archive · by Muut Archive, 9 years ago
3 1112 9 years ago