<script type="text/javascript">
$('body').on('submit', 'form', function(e) {
var $captcha = $( '#recaptcha' ),
response = grecaptcha.getResponse();
if (response.length === 0) {
e.preventDefault();
$(this).find('.captcha_error').removeClass('d-none');
$(this).find('.captcha_error').addClass('d-block');
}
});
</script>
<script src="https://www.google.com/recaptcha/api.js"
async defer>
</script>