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

Issue with modular form

Started by Muut Archive 10 years ago · 2 replies · 454 views
10 years ago

Hello! We have a form on a modular page that's been working great. Yesterday, however it stopped working correctly. This is on a custom theme as well.

I have the follow in the modular.md frontmatter:

YAML
title: 'Contact Us'
content:
    items: '@self.modular'
    order:
        by: default
        dir: asc
menu: Contact
process:
    markdown: true
    twig: true
form:
    action: /contact
    name: contact-page-form
    fields:
        - 
            name: message
            label: Message
            type: textarea
            validate:
                required: true

    buttons:
        -
            type: submit
            value: Send
            classes: 'large button float-right'
    process:
        -
            email:
                subject: '{{ form.value.name|e }}'
                body: '{% include ''forms/data.html.twig'' %}'
        -
            save:
                fileprefix: contact-
                dateformat: Ymd-His-u
                extension: txt
                body: '{% include ''forms/data.txt.twig'' %}'
        -
            message: 'Thank you for contacting us!'
        -
            display: thankyou

And the following in the module.md (form) frontmatter:

YAML
title: 'Contact form'
process:
    markdown: true
    twig: true

I have tried adding

TXT
cache_enable: false

to both and one or the other page but this didn't work either.

Whenever the form is submitted the /contact route showing like normal, but the "display: thankyou" portion does not show and the process doesn't go (no email, no saved file).

Does anyone have any ideas?

10 years ago

Are you fully up to date with all form updates? You don't need to put the form in the modular page anymore, you can put it in the modular sub-page where you want the form to display. Check the docs on the subject: https://learn.getgrav.org/forms/forms

10 years ago

I'll try this out. I haven't had much time to tinker with this particular form since posting (replaced it with a third party form as a band-aid). Thanks!

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1352 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4064 9 years ago
Archive · by Muut Archive, 9 years ago
1 2949 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago