Hi guys and girls I need help with recaptcha install on my form

I need to apply js but I am clueless a little bit how to do it

Here is my basic html code where users subscribe

<form method="post" action="https://www.alter.org/interspire/form.php?form=20" id="frmSS20" onsubmit="return CheckForm20(this);">
	<div class="myForm">
	<input type="text" name="CustomFields[15]" placeholder="Name" id="CustomFields_15_20" value="">

	<input type="text" name="email"  placeholder="Email" value="" />
	<select name="CustomFields[14]" id="CustomFields_14_20"><option value="">When is your birthday?</option><option value="1. 10. 19. or 28. day">1. 10. 19. or 28. day</option><option value="2. 11. 20. or 29. day">2. 11. 20. or 29. day</option><option value="3. 12. 21. or 30. day">3. 12. 21. or 30. day</option><option value="4. 13. 22. or 31. day">4. 13. 22. or 31. day</option><option value="5. 14. or 23. day">5. 14. or 23. day</option><option value="6. 15. or 24. day">6. 15. or 24. day</option><option value="7. 16. or 25. day">7. 16. or 25. day</option><option value="8. 17. or 26. day">8. 17. or 26. day</option><option value="9. 18. or 27. day">9. 18. or 27. day</option></select>
<input type="hidden" name="format" value="h" />

I GET SO MANY SPAM SUBMISSIONS; ITI S BREAKING MY SERVER:I want to use recaptcha from google.

I know I need to add js and I understand…
or is there another way? like creating a hidden filed that if it is filled the form will not be submitted? Please help I am desperate.
Thank you and xoxo

Hello and welcome to the community :smiley:!
Yeah you can totally do that using an anti-spam honeypot.
ReCAPTCHA can really suck when I can’t seem to get past a test but maybe its just my brain.

I used this code for js will it work or will the bots fogure it out?

<script type="text/javascript">
	           // nova medenapot instalacija

    document.addEventListener("DOMContentLoaded", function () {
        // Get a reference to your form
        var form = document.getElementById("frmSS20");

        // Add a submit event listener to your form
        form.addEventListener("submit", function (event) {
            // Get the honeypot field
            var honeypotField = form.querySelector('input[name="honeypot"]');

            // Check if the honeypot field is filled
            if (honeypotField.value !== "") {
                // Honeypot field is filled, block the submission
                alert("Submission blocked due to suspected spam. If we made a mistake contact us via email.");


also i addded html field

       <input type="text" name="honeypot" style="display: none;">

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.