Submitting a post form using JavaScript
<p>I would like to replace my HTML button with a JavaScript action. Though I need to a function to submit the form for this to work.</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta charset="UTF-8"&gt;
        &lt;title&gt;reCAPTCHA | Blazzike&lt;/title&gt;
        &lt;script src="//code.jquery.com/jquery-1.10.2.js"&gt;&lt;/script&gt;
        &lt;script src='https://www.google.com/recaptcha/api.js'&gt;&lt;/script&gt;
        &lt;script&gt; 
            $(function(){
              $("header").load("HTML/header.html"); 
              $("footer").load("HTML/footer.html"); 
            });
        &lt;/script&gt;

        &lt;script&gt;
            var submit = function(){
                document.getElementById("rec").submit();
            }
        &lt;/script&gt;
        &lt;link rel="stylesheet" type="text/css" href="CSS/style.css"&gt;
        &lt;style&gt;
            #submit {
                background: #1a1a1a;
                color: #ffffff;
                font-size: 25px;
                margin: 0px;
                padding: 0.7em;
                border: 0px;
                width: 303px;
                min-width: 250px;
            }
        &lt;/style&gt;
    &lt;/head&gt;
    &lt;header&gt;&lt;/header&gt;
    &lt;body&gt;
        &lt;center&gt;
            &lt;form id="rec" method="POST" action="&lt;?php echo $_GET["r"]; ?&gt;"&gt;
                &lt;div data-theme="dark" class="g-recaptcha" data-sitekey="&lt;siteKey&gt;" data-callback="submit"&gt;&lt;/div&gt;
                &lt;input value="Continue" type="submit" id="submit"&gt;
            &lt;/form&gt;
        &lt;/center&gt;
    &lt;/body&gt;
    &lt;footer&gt;&lt;/footer&gt;
&lt;/html&gt;
</code></pre>

<p>the script above does not work because I assume JavaScript can't submit post forms this way. Any help will do.</p>

<p>Thanks,
Blazzike.</p>