Client side validation

Created on 4 May 2023, over 1 year ago
Updated 12 December 2023, 12 months ago

Problem/Motivation

Avoid submission if the recaptcha is not filled correctly on client side.

Steps to reproduce

Add the captcha on a form and submit the form without filling the recaptcha.
The form will be submitted.

Proposed resolution

Example of how to validate the recaptcha https://html.form.guide/snippets/google-recaptcha-javascript-validation/

document.getElementById("user-register-form").addEventListener("submit",function(evt)
  {
  
  var response = grecaptcha.getResponse();
  if(response.length == 0) 
  { 
    //reCaptcha not verified
    alert("please verify you are humann!"); 
    evt.preventDefault();
    return false;
  }
  //captcha verified
  //do the rest of your validations here
  
}); 
Feature request
Status

Needs work

Version

3.0

Component

reCAPTCHA V2

Created by

🇪🇸Spain eduardo morales alberti Spain, 🇪🇺

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024