Hi all. I have problem with form handling in my site. Some time before all works normally and form saves the data. Then I updated grav and form plugin and after that form stop working. What is the problem, how i will fix and debug it. Thanks before
What do you mean by “stops working”? Are you getting an error? Is it just not reacting? Is it submitting but not saving the data?
@Perlkönig Nothing happens. Must show thankyou page, form submited,but not saving the data.I updated Form plugin from 1.3.2 to last version.
I think maybe in new version of plugin must be something other in .md file.
I have that
title: Home
menu: Home
published: true
form:
name: contact-form
fields:
- name: fname
label: First name:
size: col-xs-6
placeholder: Enter your first name
autocomplete: on
type: text
classes: form-control
validate:
required: true
- name: lname
label: Last name:
size: col-xs-6
placeholder: Enter your last name
autocomplete: on
type: text
classes: form-control
validate:
required: true
- name: email
label: Email:
size: col-xs-12 col-sm-6
placeholder: Enter your email address
type: email
classes: form-control
validate:
required: true
- name: message
label: Message:
size: col-xs-12
rows: 5
placeholder: Enter your message here
type: textarea
classes: form-control
validate:
required: true
- name: subscribe
type: checkbox
default: checked
label: "Register with Empty Legs newsletter?"
size: pull-left col-sm-6 col-xs-12 mb-2rem
validate:
required: false
buttons:
- type: submit
value: Submit my message
process:
- email:
from: "{{ config.plugins.email.from }}"
to:
- "{{ config.plugins.email.from }}"
- "{{ form.value.email }}"
subject: "[Feedback] {{ form.value.name|e }}"
body: "{% include 'forms/data.html.twig' %}"
- save:
fileprefix: feedback-
dateformat: Ymd-His-u
extension: txt
body: "{% include 'forms/data.txt.twig' %}"
- message: Thank you for your feedback!
- display: /components/thankyou
Thaks before for answers
Do you have another form on your site with the same name
??? ie contact-form
?
Yes. On the other page in .md file is the same form code
You need to ensure those names are unique for each form.
BTW, this is because of the recent improvements to forms that allow forms to be globally accessed.