How can I change the error message when using Google ReCaptcha version 2?

后端 未结 1 444
庸人自扰
庸人自扰 2021-01-27 15:31

When multiple photos are selected for the Google ReCaptcha version 2, it displays the following error message:

\"Multiple correct solutions required - pl

1条回答
  •  说谎
    说谎 (楼主)
    2021-01-27 16:18

    I think it's not possible to do server-side (at google). This rather might be done client-side by leveraging js to substitute HTML of the newly received reCaptcha pictures code:

    HTML

    Multiple correct solutions required – please solve more.

    so you find this line of code and replace:

    JS (Jquery)

    $('.rc-imageselect-incorrect-response').text('Custom message');
    

    When?

    This action you should perform each time after XHR https://www.google.com/recaptcha/api2/userverify?k=6LdYKQkTAAAAAD9K6-kHspFU... is complete. Yet since this ajax request is done by google's reCaptcha's api code, it's not that easy to catch up with it.

    0 讨论(0)
提交回复
热议问题