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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Forms & Blueprints

Does basic-captcha need a secret?

form

Solved by pamtbaau View solution

Started by Gero Krüger 3 years ago · 3 replies · 1141 views
3 years ago

I want to use basic-captcha in a form.md (for several reasons I don't want google's reCaptcha). Now I get the crikey "RuntimeException: No secret provided". I think I don't need a secret for basic-captcha?!

3 years ago Solution

@geradok,

I think I don’t need a secret for basic-captcha?!

I think you're right...

Using a fresh install of latest Grav:

  • Created a contact form
  • Followed the docs for the Basic Captcha field:

    • Added the Basic Captcha field to the form
    • Added the proper process entry to the form
    YAML
    ---
    title: Basic Captcha
    form:
    name: captchaform
    fields:
      name:
        type: text
      basic-captcha:
        type: basic-captcha
        placeholder: copy the 6 characters
        label: Are you human?
    buttons:
      submit:
        type: submit
    process:
      basic-captcha:
        message: Humanity verification failed, please try again...
    ---
    

Form is working fine.

Untitled|690x403

3 years ago

Thank you so much! I learned that the NAME of the element (not only the TYPE) has to be 'basic-captcha' and not 'captcha', which is to me a little bit unexpected. My (not working) version was:

YAML
    captcha:
        type: basic-captcha
        placeholder: copy the 6 characters
        label: Are you human?
  buttons:
    submit:
      type: submit
      value: Submit
  process:
    captcha:
      message: Try Again!
3 years ago

@geradok, I don't think your assumption is correct. It is the name of the process variable that must be basic-captcha. That process variable tells the form how the submitted form should be processed.

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1138 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 61 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 135 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 110 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 129 7 months ago