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

Form not working after grav updating

Started by Muut Archive 10 years ago · 6 replies · 673 views
10 years ago

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

10 years ago

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?

10 years ago

@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

YAML
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

10 years ago

Do you have another form on your site with the same name ??? ie contact-form ?

10 years ago

Yes. On the other page in .md file is the same form code

10 years ago

You need to ensure those names are unique for each form.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1360 9 years ago
Archive · by Muut Archive, 9 years ago
2 938 9 years ago
Archive · by Muut Archive, 9 years ago
2 4068 9 years ago
Archive · by Muut Archive, 9 years ago
1 2958 9 years ago
Archive · by Muut Archive, 9 years ago
3 1122 9 years ago