horprogs / Just-validate

Modern, simple, lightweight (~5kb gzip) form validation library written in Typescript, with no dependencies (no JQuery!). Support a wide range of predefined rules, async, files, dates validation, custom error messages and styles, localization. Support writing custom rules and plugins.
https://just-validate.dev/
Other
498 stars 91 forks source link

Recaptcha Validation #123

Open moshetanzer opened 1 year ago

moshetanzer commented 1 year ago

Is your feature request related to a problem? Please describe. Yes, most forms have recaptchas, however if we are using your libary it would be nice that we could use it for everything in form including recaptcha.

Describe the solution you'd like Implement recaptcha validation using this basic js

var response = grecaptcha.getResponse(); if (response.length === 0) { event.preventDefault(); // Prevent form submission

document.getElementById('recaptchafeedback').style.display = "block";
 /// alert("Please complete the reCAPTCHA challenge.");
  return false; // Prevent form submission
} else {}

Thanks for libary. 
horprogs commented 1 year ago

Hey, a good suggestion, thanks. I will look what I can do