BetterForms keeps asking for Captcha Topic is solved

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm
Location: Nederland

BetterForms keeps asking for Captcha

Post by rooon »

Hi all,

I have the following BetterForms template. The UDT "better_forms_errors" checks if there is dirty stuff in the form fields and returns this in an array. First, I did have the Captcha <div> in the template but I removed ihe Captcha module (uninstall and remove files). So I did also remove the Captcha <div> line from the template. But now, after a scan, BetterForms keeps asking for the Captcha line in the template.

"NOTICE: No captcha container was detected in the form markup."

Any suggestion is welcome.

Code: Select all

{cgbf_form_errors assign='errors'}{strip}
{better_forms_errors errors=$errors assign="ErrArray"}
{$fieldErr = $ErrArray["strSumErr"]}
{/strip}{if !empty($errors)}
<div class="mt-2 alert alert-info form-summary">
<ul class="bf-alert list-unstyled">
{if ($ErrArray["errCaptcha"])}<li>De captcha code komt niet overeen.</li>{/if}
{if ($ErrArray["errEmail"])}<li>Het emailadres is niet correct.</li>{/if}
{if ($ErrArray["errUpload"])}<li>Uploaden van het bestand is niet gelukt.</li>{/if}
{if ($ErrArray["errInvalid"])}<li>Velden voldoen niet aan criteria: {$ErrArray["strInvalid"]}</li>{/if}
{if ($ErrArray["errAllowed"])}<li>Linkje of email niet toegestaan: {$ErrArray["strAllowed"]}</li>{/if}
{if ($ErrArray["errOther"])}<li>{$ErrArray["strOther"]}</li>{/if}
</ul>
</div>
{/if}
<form id="form1" novalidate>

<div class="form-group form-row bf-text01">
<div class="col-12">
Uitgebreid kan ik je informeren over de begeleiding die het beste bij je past. Vraag gerust om meer informatie. Graag tot ziens!
</div>
</div>

<div class="form-group form-row bf-naam{if $fieldErr|stripos:'naam' !== false} bf-error{/if}">
  <div class="col-sm-2 col-form-label">Naam</div>
  <div class="col-sm-10 pt-2 pb-1">
    <div class="form-check form-check-inline">
      <input type="radio" name="geslacht" id="geslacht_1" value="Dhr." checked>
      <label for="geslacht_1"><span></span>Dhr.</label>
    </div>
    <div class="form-check form-check-inline">
      <input type="radio" name="geslacht" id="geslacht_2" value="Mevr.">
      <label for="geslacht_2"><span></span>Mevr.</label>
    </div>
  </div>
  <label for="naam_0" class="col-sm-2"><span class="sr-only">Naam</span></label>
  <div class="col-sm-10 py-1">
    <input class="form-control form-control-sm" name="naam" id="naam_0" type="text" placeholder="* Nicole Hendriks" >
  </div>
</div>

<div class="form-group form-row bf-email{if $fieldErr|stripos:'email' !== false} bf-error{/if}">
  <label for="email_0" class="col-sm-2 col-form-label">Emailadres</label>
  <div class="col-sm-10">
    <input class="form-control form-control-sm" name="email" id="email_0" type="email" placeholder="* nicole@gmail.com">
  </div>
</div>

<div class="form-group form-row bf-telefoon{if $fieldErr|stripos:'telefoon' !== false} bf-error{/if}">
  <label for="telefoon_0" class="col-sm-2 col-form-label">Telefoon</label>
  <div class="col-sm-10">
    <input class="form-control form-control-sm" name="telefoon" id="telefoon_0" type="text" placeholder="071 1234567">
  </div>
</div>

<div class="form-group form-row bf-adres{if $fieldErr|stripos:'adres' !== false} bf-error{/if}">
  <label for="adres_0" class="col-sm-2 col-form-label">Adres</label>
  <div class="col-sm-10">
    <input class="form-control form-control-sm" name="adres" id="adres_0" type="text" placeholder="Tulpstraat 173">
  </div>
</div>

<div class="form-group form-row bf-postcode{if $fieldErr|stripos:'postcode' !== false} bf-error{/if}">
  <label for="postcode_0" class="col-sm-2 col-form-label">Postcode</label>
  <div class="col-sm-10">
    <input class="form-control form-control-sm" name="postcode" id="postcode_0" type="text" placeholder="2252 VA">
  </div>
</div>

<div class="form-group form-row bf-woonplaats{if $fieldErr|stripos:'woonplaats' !== false} bf-error{/if}">
  <label for="woonplaats_0" class="col-sm-2 col-form-label">Woonplaats</label>
  <div class="col-sm-10">
    <input class="form-control form-control-sm" name="woonplaats" id="woonplaats_0" type="text" placeholder="Voorschoten">
  </div>
</div>

<div class="form-group form-row bf-bericht{if $fieldErr|stripos:'bericht' !== false} bf-error{/if}">
  <label for="bericht_0" class="col-sm-2 col-form-label">Bericht</label>
  <div class="col-sm-10">
    <textarea class="form-control" name="bericht" id="bericht_0" placeholder="* Mijn vraag" rows="8"></textarea>
  </div>
</div>

<div class="form-group form-row bf-submit{if $fieldErr|stripos:'captcha' !== false} bf-error{/if}">
  <div class="col-12 pt-2">
    <button class="btn float-right" type="submit">Verstuur</button><!--disabled="disabled"-->
    <button class="btn float-right formModal-btn mr-3" type="button" name="form1help"> &#9432; </button>
  </div>
</div>

</form>
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1627
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: BetterForms keeps asking for Captcha

Post by DIGI3 »

Under the Validation tab, perhaps you still have the "Validate Captcha" item? I haven't tested if that returns an error if no captcha div is present, but seems possible.
Not getting the answer you need? CMSMS support options
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm
Location: Nederland

Re: BetterForms keeps asking for Captcha

Post by rooon »

There are no validation rules. I removed the contactform and created a new one. The problem is still there.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: BetterForms keeps asking for Captcha

Post by velden »

Looking at the code it seems like the captcha is required unless you have a <p> element in the form with a data-cgbf-nocaptcha attribute.
I guess something like

Code: Select all

<p data="cgbf-nocaptcha"></p>
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm
Location: Nederland

Re: BetterForms keeps asking for Captcha

Post by rooon »

@velden. Thanx for your help, it works! I used this:

Code: Select all

<div data-cgbf-nocaptcha></div>
The same line as data-cgbf-captcha but now using "nocaptcha"

Lazy me ;) I'm pretty sure it's in the documentation
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: BetterForms keeps asking for Captcha

Post by velden »

You're right of course about both the attribute and div is allowed too, missed that.

I checked documentation before posting but didn't find the explicite notes about NOT using captcha.

Good to hear it's solved now.
Post Reply

Return to “Modules/Add-Ons”