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

Reset a form

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

Hello,
I'm using the form plugin. Having removed the "display" section, I need to reset my fields after submit.

I tried this method but nothing changed. I'm a beginer, so maybe I did it wrong?
A sample of my modular.md:

YAML
form:
    name: contactform
    action: /home#contact
    fields:
        -
            name: message
            [...]
            validate:
                required: true
        -
            name: g-recaptcha-response
            [...]
            validate:
                required: true
    buttons:
        - 
            type: submit
            value: Submit
    process:
        -
             [...]
    reset: true 

I tried to put the reset:true in multiple places but no success (just got some error messages).
Sure that I'm doing it wrong but what's the good way?

Thanks for your attention.
Pauline.

10 years ago

Try this:

TXT
process:
        - .... other processing
        - reset: true

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1999 9 years ago
Archive · by Muut Archive, 9 years ago
2 1342 9 years ago
Archive · by Muut Archive, 9 years ago
2 4549 9 years ago
Archive · by Muut Archive, 9 years ago
1 3402 9 years ago
Archive · by Muut Archive, 9 years ago
3 1493 9 years ago