How to reload the google recaptcha widget after user submits invalid inputs

前端 未结 11 1649
既然无缘
既然无缘 2020-12-25 12:08

I have a registration form with the new google recaptcha widget on it. When a user submits info, we check the validation with javascript and return the problems to the page

11条回答
  •  醉话见心
    2020-12-25 12:35

    I had same problem with excelwebzone/recaptcha-bundle for Symfony2. Basicly is says that recaptcha was loaded in past to your DOM and placeholder that should be empty was full.

    Those bundles dont have settings for explicit callbacks so you have to make sure that placeholder or even whole form is empty before you load recaptcha.

    And mine was stuck in DOM cause i was loading it with AJAX. On second call it was there.

    You can simply use $('#your-div-with-form').html('')

提交回复
热议问题