Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

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

Started by Matt Jones 8 years ago · 0 replies · 810 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 DrPen, 1 month ago
2 478 1 month ago
Plugins · by renedebaaij, 2 months ago
1 351 1 month ago
Plugins · by Thomas, 1 month ago
1 375 1 month ago
Plugins · by complanar, 2 months ago
6 699 2 months ago
Plugins · by BenLaKnet, 2 months ago
1 642 2 months ago