jQuery on submit issue
<p>For some reason my submit event is not working, however, if i change it to click on the form, it works, this is my code:</p>

<p><strong>JQUERY:</strong></p>

<pre><code> &lt;script&gt;
(function(){
        $('form').on('click',function(){

                $.post("../includes/register.php",  $('form').serialize(),
                function(data){
                    $('body').append(data);                 
                });
        });
    })();
&lt;/script&gt;
</code></pre>

<p><strong>REGISTER.PHP:</strong></p>

<pre><code>&lt;?php 

if(isset($_POST['username'])){
echo $_POST['username'];
}
?&gt;
</code></pre>

<p>This works perfectly fine, it appends the username whenever I click on a form text input, however, when I try to use the submit method, it doesnt output anything:</p>

<pre><code>&lt;script&gt;
(function(){
        $('form').submit(function(){

                $.post("../includes/register.php",   $('form').serialize(),
                function(data){
                    $('body').append(data);                 
                });
        });
    })();
&lt;/script&gt;
</code></pre>

<p>As a matter of fact, it doesn't even work when I use button.on('click')</p>
