How to check form input fields when using invisible reCAPTCHA

Hello,

I want to check form input fields when using invisible reCAPTCHA
“required” doesn’t work
Form continues with javascript/Jquery
how to do this

<script src='https://www.google.com/recaptcha/api.js'></script>
<script src="https://code.jquery.com/jquery-1.9.1.js"></script>

<form action="" method="POST" id="theForm">

    <script>
        function kontrol(){

        var email              = $.trim($('#email').val());
        var password           = $.trim($('#password').val());

        if(password==""){
            alert("You did not enter a password");
            return false;
        }

        if(email==""){
            alert("You did not enter a email");
            return false;
        }

        }

    function submitForm() {
        document.getElementById("theForm").submit();
    }

    </script>

    <input type="text" name="email" id="email" placeholder="Email" required>
    <input type="password" name="password" id="password" placeholder="Password" required>

    <div class="g-recaptcha" data-sitekey="SITE-KEY" data-bind="recaptcha-submit" data-callback="submitForm"></div>

    <input type="submit" name="login" class="loginmodal-submit" id="recaptcha-submit" value="Login" onclick="return kontrol();" />

</form>
Sponsor our Newsletter | Privacy Policy | Terms of Service