No reCAPTCHA error message

No reCAPTCHA error message

by Pete Jones -
Number of replies: 2

Hi,

I've got reCAPTCHA enabled for email-based self-registration and it's working okay (i.e. if a user enters the reCAPTCHA image correctly, they can create a new account).

However, if the user enters the reCAPTCHA numbers/letters incorrectly, there's no error message and the user just remains on the 'Create a new account' page without being told to reenter the reCAPTCHA numbers/letters.

The reCAPTCHA image is refreshed so they may notice they have to reenter it themselves but it isn't highlighted in any way.

Does anyone know if there's a way to highlight the error so that it doesn't rely on the user having to notice it themselves?

I'm using Moodle 2.6.2

Pete



Average of ratings: -
In reply to Pete Jones

Re: No reCAPTCHA error message

by James Jewell -

Hi Pete,

I just had this issue, though I'm not sure if it's the same version.  However, I found that the error actually was being generated, but CSS was causing it not to show.  To fix this, I edited "recaptcha.php" (/members/lib/form/recaptcha.php) on line 81.


Before:

<div class="recaptcha_only_if_incorrect_sol" style="color:red">' . $strincorrectpleasetryagain . '</div>


After:

<div class="recaptcha_only_if_incorrect_sol" style="color:red; '.($strincorrectpleasetryagain ? ' display: block !important;' : '').'">' . $strincorrectpleasetryagain . '</div>