getgrav / getgrav/grav-plugin-form
Form submit without action/redirect/display
- Dominant language
- PHP
- Stars
- 64
- Forks
- 80
- Avg merge
- 10h 13m
- Merged PRs (30d)
- 9
Description
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_'
```html
---
title: My contact Form
process:
markdown: true
twig: true
form:
name: contact-form
fields:
- name: email
label: Recevoir toutes les nouveautés directement
autocomplete: on
placeholder: Votre e-mail
type: email
buttons:
- type: submit
value: Valider
process:
- save:
filename: newsLetterFR.csv
extension: csv
body: "{{ form.value.email|e }}\n"
operation: add
---
```
Maybe the problem is how I integrated the form in '_myThemeDerivatedFromQuark/templates/partials/sidebar.html.twig_
```html
{% include "embedded_form.html.twig" with { form: forms('contact-form') } %}
```
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...
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.