4

Our web-to-case form has been on our website for a few months. At first, no reCaptcha was in place, but after receiving 30 spams in one weekend, we decided to activate the Google reCaptcha option.

The form with reCaptcha works for 95% of our customers, but a few (and myself) cannot create a case. All seems normal, we are redirected to the retURL, but no case is created in Salesforce and the customer doesn't get an email confirmation neither.

I called Salesforce about it, and they sent me the back-end message they got:

REQ_PARAM_NAME::encoding
REQ_PARAM_VALUE::UTF-8
REQ_PARAM_NAME::subject
REQ_PARAM_VALUE::This case is a test ...
REQ_PARAM_NAME::g-recaptcha-response
REQ_PARAM_VALUE::03AOLTBLQoO1moZja1464kCW1Gx5rlbTPBHHhG31s5M_gorG_VaAEXCnv7qmXTvyo9xKM299E8DfDaRHsgmPcKWK-nkhcLhGvo-NkF_iet6CwHhPu_pV4A3t-wmiZWXbdazguAYnBjBv4SRFW6oUaINrKxhkz9JdoClhMAhLc3qJwKD-_8yxUTMx5RsbGGDeIAAqyrIWMW69p76qH-upuXPlxldNFF7RscGzJfpkB-WaCL1Zo2dqov4ykYZ4cw9mMAsSR3GTzY7yp7kshnrGwATnNQLoSU1O5p4gl7eig6zB5xJu9WYYvmBvtctsiWDimpbKd3Ux-fF9aj
REQ_PARAM_NAME::submit
REQ_PARAM_VALUE::Send
REQ_PARAM_NAME::validated-captcha
REQ_PARAM_VALUE::Pair(false,Unable to validate in time. Response is assumed correct. 101781)

Any idea what this "Unable to validate in time" message means?

Should I contact Salesforce support again about this? They didn't seem to know what was the problem and encoraged me to contact Google...

2
  • Philippe, did you ever get a better answer from Salesforce or figure out a solution to the reCaptcha issue on your own? We started having the exact same issue at the end of March (including "Unable to validate in time. Response is assumed correct."), but Salesforce just keeps saying reCaptcha support is "out-of-scope". Commented Jun 8, 2020 at 18:45
  • 1
    They refuse to take responsability, but the validation is done on their part. IMO, they should analyse the message and accept "Unable to validate in time" as a valid attempt... I removed the reCaptcha since and delete the spam manually from time to time. I tried some Javascript to change the timestamp (suggested by someone) but it didn't work, so I stopped putting time on this.
    – Philippe
    Commented Jun 9, 2020 at 14:15

1 Answer 1

0

The HTML offered by Salesforce in their "auto generator" is faulty or incomplete. The problem is that the submit button is not constrained by the value of the reCAPTCHA field. This lets the user submit the form even if there's no value (no checked box) in the reCAPTCHA field. The javascript provided at the top of Salesforce's auto-generated HTML only tells Salesforce to ignore the submitted data; it does not prevent the user from submitting the form and thinking it was successful. This is easily fixed by disabling the submit button until the reCAPTCHA field is satisfied.

Add a data-callback to the recaptcha:

<div class="g-recaptcha" data-sitekey="#######" data-callback="enableButton"></div>

Make sure the button has an id:

<input type="button" value="Submit" id="salesforcebutton" disabled="disabled">

Finally add javascript that enables the button as part of that data-callback:

<script>
 function enableButton(){
   document.getElementById("salesforcebutton").disabled = false;
 }
</script>
2
  • 1
    The HTML being faulty might be true but the root cause and the answer to the question has to do with the clock on the client: stackoverflow.com/questions/58138707/…
    – identigral
    Commented Jan 14, 2023 at 2:33
  • 1
    It is all somewhat related. The javascript at the top of Salesforce's generated HTML will alter the clock/timing (aka "interval") if the form is submitted without passing the reCAPTCHA test.
    – JimO
    Commented Jan 14, 2023 at 22:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .