jQuery: form and ajaxcall
<p>I would like to make an ajax call on submit.</p>

<pre><code>&lt;form id="editMail" action="" method="post"&gt;
    &lt;input name="user_email" type="text" value="mail" maxlength="50" id="user_email" style="width:200px;"&gt;
    &lt;input name="submit" type="submit" id="submit_editMail" value="Ändra"&gt;
&lt;/form&gt;


    $('#editMail').submit(function() {
            $.ajax({
            type: "POST",
            url: "misc/email/activate.php",
            data: { action: 'edit', user_email: new_usermail },
            success: function(r){
            if(typeof(r.error) != 'undefined') {
            if(r.error != ''){
            alert(r.error);
            }
                }else{
           alert('OK');
        }
      });
    });
</code></pre>

<p>But still nothing is happening, it doesnt do the ajax call but only refersh the page it's on. I tried adding onClick="return false;" to the submit button, but then nothing at all happens</p>
