Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6909715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:43:28+00:00 2026-05-27T08:43:28+00:00

I’m trying to implement Recaptcha to Silverstripe, it is all working well but the

  • 0

I’m trying to implement Recaptcha to Silverstripe, it is all working well but the compulsory message ‘Please answer the captcha question’ wouldn’t shown on only one of my forms when the captcha info is not filled.

Can anyone give me some directions on how to fix this problem? Thanks heaps.

This is what i’ve done after following the steps and installed recaptcha and spamprotection.

I added new RecaptchaField(‘MyCaptcha’) to my BookingFormPage.php

$fields = new FieldSet(
        $TourDropDown, 
        new TextField('FirstName'),
        new TextField('LastName'),
        new TextField('EmailAddress')
        new DropdownField('People','People Travelling',$People),
        new DropdownField('Accommodation','Accommodation Standard',$Accommodation),
        new DropdownField('Rooms','How Many Rooms',$Rooms),
        new DropdownField('Transport','Transport Option',$Transport),
        new DropdownField('TransportSelfDrive','If self drive select grade',$TransportSelfDrive),
        new TextField('FlightArrival','Flight Arrival Details'),
        new TextField('FlightDeparture','Flight Departure Details'),
        new DropdownField('LengthOfStay','Length of stay',$LengthOfStay),
        new TextareaField('Comments'),
        **new RecaptchaField('MyCaptcha')**

    );

and I added 

<div class="formHoizontal">
<div id="MyCaptcha" class="field recaptcha ">
$dataFieldByName(MyCaptcha) 
</div>
</div>

to the BookingForm.ss

<form $FormAttributes class="threecolumnform">
<% if Message %>
  <p id="{$FormName}_error" class="message $MessageType">$Message</p>
<% else %>
  <p id="{$FormName}_error" class="message $MessageType" style="display: none"></p>
<% end_if %>
<fieldset>
<div class="formHoizontal">
        <div class="field text">
            <label class="left" for="$FormName_Tour">Tour</label>
            $dataFieldByName(Tour)
        </div>
    </div>
    <div class="clear"></div>
    <div class="formHoizontal">
        <div id="FirstName" class="field text">
            <label class="left" for="$FormName_FirstName">First name</label>
            $dataFieldByName(FirstName)
        </div>
        <div>
            <label class="left" for="$FormName_LastName">Last name</label>
            $dataFieldByName(LastName)
        </div>
    </div>
    <div class="clear"></div>
    <div class="formHoizontal">
        <div id="EmailAddress" class="field email">
            <label class="left" for="$FormName_EmailAddress">Email</label>
            $dataFieldByName(EmailAddress)
        </div>

    </div>
    <div class="clear"></div>
    <div class="formHoizontal">

        <div class="field text">
            <label class="left" for="$FormName_LengthOfStay">Length of stay</label>
            $dataFieldByName(LengthOfStay)
        </div>
    </div>
    <div class="clear"></div>


    <div class="formHoizontal">
        <div class="field text">
            <label class="left" for="$FormName_People">Number of Adults</label>
            $dataFieldByName(People)
        </div>


    </div>


    <div class="clear"></div>
    <br />
    <h4>Accommodation</h4>
    <div class="formHoizontal">
        <div class="field text">
            <label class="left" for="$FormName_Accomadation">Type</label>
            $dataFieldByName(Accommodation)
        </div>
        <div class="field text">
            <label class="left" for="$FormName_Rooms">Number of rooms</label>
            $dataFieldByName(Rooms)
        </div>
        <div class="field text">
            <label class="left" for="$FormName_RoomConfig">Room requirements</label>
            $dataFieldByName(RoomConfig)
        </div>
    </div>


    <div class="clear"></div>
    <br />
    <h4>Transport</h4>
    <div class="formHoizontal">
        <div class="field text">
            <label class="left" for="$FormName_Transport">Type</label>
            $dataFieldByName(Transport)
        </div>

        <div>
            <label class="left" for="$FormName_TransportSelfDrive">If self drive select grade</label>
            $dataFieldByName(TransportSelfDrive)
        </div>
        <div class="clear"></div>
    </div>


    <div class="clear"></div>
        <div>
            <div class="field text">
                <label class="left" for="$FormName_SightSeeing">Enter any sightseeing or activities you would like included</label>
                $dataFieldByName(SightSeeing)
            </div>
        <div><h4>Sightseeing</h4></div>
        </div>
    <br />

    <div class="formHoizontal">
        <div class="field text">
            <label class="left" for="$FormName_FlightArrival">Flight Arrival Details</label>
            $dataFieldByName(FlightArrival)
        </div>
        <div class="field text">
            <label class="left" for="$FormName_FlightDeparture">Flight Departure Details</label>
            $dataFieldByName(FlightDeparture)
        </div>
    </div>

    <div class="clear"></div>
    <br /><br /><br />


        **<div class="formHoizontal">
        <div id="MyCaptcha" class="field recaptcha ">
            $dataFieldByName(MyCaptcha)

    </div>
    </div>**


    <div class="clear"></div>
    <br /><br /><br />



    <div class="formHoizontalTwoColumn">

        <div class="field text">
            <label class="left" for="$FormName_Comments">Extra Information</label>
            $dataFieldByName(Comments)
        </div>
    </div>


  $dataFieldByName(SecurityID)

Thanks a lot.

Kind regards
Sam

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:43:28+00:00Added an answer on May 27, 2026 at 8:43 am

    the compulsory message ‘Please answer the captcha question’ wouldn’t shown on only one of my forms when the captcha info is not filled

    Do you mean it didn’t show at all or it showed multiple times?

    My template looks like this (including the CSS grid etc.) – which should show error messages:

    <div class="push_2 grid_15 formbackground">
        <div class="grid_4">
            <label for="recaptcha_response_field" class="right">Captcha*<br/><span>Bitte die Zeichen der Grafik in das Feld eingeben</span></label>
        </div>
        <div class="grid_9">
            $dataFieldByName(MyCaptcha)
            <span class="message $dataFieldByName(MyCaptcha).MessageType">$dataFieldByName(MyCaptcha).Message</span>
        </div>
    </div>
    

    Does that help?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.