I would like to implement reCaptcha in my Laravel project without using Laravel packages. I have tried with classical reCaptcha V2 which works, but I would like to implement invisible reCaptcha instead.
So what I did is this:
<form id="subscribeForm" class="form-inline" role="form" method="post" action="/subscribe" style="margin-bottom:70px;">
...
...
<button type="submit" class="btn btn-default">{{trans('content.input_submit')}}</button>
<div id="recaptcha" class="g-recaptcha" data-sitekey="---my---key---" data-size="invisible" data-callback="onSubmit"></div>
<script> ...callback functions... </script>
</form>
I got the floating reCaptcha bar on the right appear correctly, but of course since I need a button to perform actual submission I have a button with type submit, and none of the callback functions from reCaptcha div get triggered. When I return the request I get g-recaptcha-response empty.
Why doesn't it get submitted independent of the callback?