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

Reset a form

Started by Muut Archive 9 years ago · 2 replies · 782 views
9 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.

9 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 1345 9 years ago
Archive · by Muut Archive, 9 years ago
2 932 9 years ago
Archive · by Muut Archive, 9 years ago
2 4059 9 years ago
Archive · by Muut Archive, 9 years ago
1 2945 9 years ago
Archive · by Muut Archive, 9 years ago
3 1117 9 years ago