Amateur hour here.
I have an existing HTML contact form. It's not my code. This is a summarized version of it. It has an input field that is a button. There is a function defined for when the button is clicked which I believe is wrapped in a jQuery selector. This function then calls the form's submit function, also wrapped in jQuery.
$("#contact-form .submit-button").on("click", function (e) {
$("#contact-form").submit()
}
$("#contact-form").on("submit", function (e) {
})
When I add a reCaptcha, I can provide a call back function. I want to directly call the form's submit function. I tried:
<div style="margin-top:5px;margin-bottom:15px;" id="reCaptcha" data-size="invisible" class="g-recaptcha" data-sitekey="myKey" data-callback="$("#contact-form").submit"></div>
But, it doesn't seem to do anything. I think I can add a helper function, but is there a direct way to pass the form's submit function to this reCaptcha HTML element?