Skip to content

Unable to submit form after captcha invalid submission #610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
GianlucaLocri opened this issue Mar 26, 2025 · 0 comments
Open

Unable to submit form after captcha invalid submission #610

GianlucaLocri opened this issue Mar 26, 2025 · 0 comments

Comments

@GianlucaLocri
Copy link

Hi!
I have a modular page with a contact form.
Basically if I insert the wrong captcha the validation message is correctly showed but then if I try to correct the code and submit again, a "form already submitted" message is shown and the processing (sending of the email) is not executed.

I think that can be a similar problem to issue 489 that was solved by an update few years ago.

I'm using
Grav v1.7.48
Form v7.4.2
PHP Version 8.4.1

My frontmatter code for the contact page is the following:

subtitle: 'Ottieni più informazioni'
section_classes: 'bg-primary-darker text-primary-lighter py-8 md:py-24'
title_text: light
form:
    name: contact
    action: '#contact'
    inline_errors: true
    fields:
        name:
            label: Name
            display_label: false
            placeholder: 'Il tuo nome'
            autocomplete: 'on'
            type: text
            validate:
                required: true
        email:
            label: Email
            display_label: false
            placeholder: 'Il tuo indirizzo mail'
            type: email
            validate:
                required: true
        phone:
            label: Phone
            display_label: false
            placeholder: 'Il tuo numero di telefono (opzionale)'
            type: text
        message:
            label: Message
            display_label: false
            placeholder: 'Il tuo messaggio'
            type: textarea
            rows: 4
            validate:
                required: true
        basic-captcha:
            label: 'Are you human?'
            display_label: false
            type: basic-captcha
            placeholder: 'Inserisci i caratteri visualizzati'
    buttons:
        submit:
            type: submit
            classes: 'no-default-style text-white bg-gray-700 hover:bg-primary'
            value: 'Submit Form'
    process:
        basic-captcha:
            message: 'Verifica del codice captcha fallita... Riprova'
        email:
            subject: 'Contact by {{ form.value.name|e }}'
            body: '{% include ''forms/data.html.twig'' %}'
        message: '<b>Grazie!</b> Il messaggio è stato inviato, riceverai una risposta appena possibile.'
        reset: true
cache_enable: false```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant