Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Ajax form plugin submit without page refresh and capture in plugin.php

Started by Matt Jones 8 years ago · 0 replies · 743 views
8 years ago

Hi, I am new to grav, php and ajax so its a steep learning curve for me. I am trying to create a plugin which has a form (At the moment this form is just defined in the twig template), which is submitted using ajax:
https://learn.getgrav.org/15/forms/forms/how-to-ajax-submission
I need to capture the form data within the plugins php, I have tried using onFormProcessed event with no luck.
I have seen this previous post about ajax and plugins but I need more help.

Where and how should i capture the ajax form data?

Also, capturing the $_POST the traditional way in pageInitialize with a page refresh was working correctly.

last edited 03/30/19 by Matt Jones

Suggested topics

Topic Participants Replies Views Activity
Plugins · by renedebaaij, 12 hours ago
0 16 12 hours ago
Plugins · by complanar, 2 weeks ago
6 379 2 weeks ago
Plugins · by BenLaKnet, 2 weeks ago
1 197 2 weeks ago
Plugins · by complanar, 1 month ago
2 472 4 weeks ago
Plugins · by Vladimir Novak, 2 months ago
3 750 2 months ago