-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Form submit without action/redirect/display #367
Comments
You might want to ask this on the forum, since it is not really an issue with Grav. Also it is probably more related to the form plugin that has its own repository. That said, perhaps the How to: Forms in modular pages might help? I don't have much experience with forms, but have you tried adding a page parameter to the |
You should set the action to the route of the page that contains the sidebar as that is the page you want to end up on. |
I don't know how to get that url, the form is located in a partial template integrated in all the pages of my site. I tried page.url, but it returns the adress of the generic .md file containing the form. |
That is a little tricky, actions are tied to forms so having different actions on the same form is not currently possible. Couple of workaround approaches:
|
You could try the |
I have a form embedded in my custom sidebar and I want the user to stay on the same page after the validation. The problem is that the validation cause the form to display itself replacing the whole page.
Here is the markdown 'pages/modules/subscribe/form.fr.md'
Maybe the problem is how I integrated the form in 'myThemeDerivatedFromQuark/templates/partials/sidebar.html.twig
I tried action: "." , action: "" , action: . , action: without success.
I think the problem comes from 'plugins/form/templates/forms/default/form.html.twig' line 20
'{% set action = form.action ?: page.route ~ uri.params %}'
"form.action" is defaulted to "modules/subscribe" by the calling code. I tried to backtrace the problem but failed miserably...
The text was updated successfully, but these errors were encountered: