django-recaptcha2 icon indicating copy to clipboard operation
django-recaptcha2 copied to clipboard

Reload on ajax

Open PSzczepanski1996 opened this issue 5 years ago • 1 comments

How to reload this plugin after ajax request?

$('#id_input').keyup(function(e){
        let url = index_url;
        $.ajax({
            type: "POST",
            url: url,
            data: {
                'input': $('#id_input').val(),
                'offer_type': $('#id_offer_type').val(),
                'category': $('#id_category').val()
            },
            success: function (data) {
                $('#offer-objects').html(data);
            },
            complete: function(){
                SwiperReload();
            },
        });
    });

Something like that. If recaptcha is inside div with ID offer objects (#offerobjects) it does not load after ajax request finished (inside success function).

Any ideas?

PSzczepanski1996 avatar Dec 03 '18 09:12 PSzczepanski1996

I think that the real problem is the activation from the google script. Did you tried to use the explicit version and to call the activation call after the ajax update?

kbytesys avatar Dec 20 '18 15:12 kbytesys