Newer
Older
codeigniter4-recaptcha / Views / init_v3.php
@Réz István Réz István on 27 Jan 2022 436 bytes fix recaptcha3 bug
<?php if($init):?>

<script type="text/javascript" src="https://www.google.com/recaptcha/api.js?render=<?= $key;?>"></script>

<?php endif;?>

<script type="text/javascript">

grecaptcha.ready(function() {
    grecaptcha.execute('<?= $key;?>', <?= json_encode($options);?>).then(function(token) {
        document.getElementById('<?= $id;?>').value = token;
        document.getElementById('<?= $id;?>').oninput;
    });
});

</script>