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

GRAV form submit in modular page

Started by Muut Archive 10 years ago · 5 replies · 457 views
10 years ago

I have successfully implemented contact from in a modular page. However when I submit the form the page gets reloaded, since the form action is the same page. Instead of that I would like to get a json response, based on which a message will be shown to the user. I found a form json twig file, but could not get its use.

10 years ago

It's not currently possible to force JSON ouput. The URL itself needs to end with .json for that to happen. An issue has been submitted. You could maybe change the form action to redirect to the page with a .json extension and see if that fixes it, though.

10 years ago

Thanks for your reply and sorry for being late. I have checked the url you have provided. And sorry again for being dumb, as I could not get what I need to do. Can you please provide some sample code.

10 years ago

Thanks for reply. I will check the documents.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1357 9 years ago
Archive · by Muut Archive, 9 years ago
2 936 9 years ago
Archive · by Muut Archive, 9 years ago
2 4066 9 years ago
Archive · by Muut Archive, 9 years ago
1 2955 9 years ago
Archive · by Muut Archive, 9 years ago
3 1121 9 years ago