Ajax表单不会发送我的数据

$(document).ready(function() {

$("#msform").submit(function(e){
    e.preventDefault();

    $("#editjeeinde").hide();
    $("#loading").show();

    $('#msform').ajaxForm(function() {
        $("#loading").hide();
        $("#done").show();
    });
});
});

It just doesn't submit my form to the php page as shown in my html form:

<form id="msform" action="sent.php" method="post" enctype="multipart/form-data">

My submit button and the loading div and finishing div shown after the form has been sent:

    <input type="submit" name="submit" class="submit action-button" value="Verzenden" id="submit" />
    </div>
    <div id="loading">
    <p>Bezig met verzenden...<br /><img src="loader.gif" /></p>
    </div>
    <div id="done">
    <p>Uw aanvraag is succesvol ingediend. Wij zullen deze binnen 1-2 weken verwerken en u hiervan op de hoogte brengen.</p>
    </div>

It just keeps loading... Anyone see the problem?

Just found the answer myself. You can't use the .submit function together with the Form plugin. So I changed it to:

$("#msform").on("submit",function(e){
    e.preventDefault();

    $("#editjeeinde").hide();
    $("#loading").show();

    $("#msform").ajaxSubmit(function() {
        $("#loading").hide();
        $("#done").show();
    });
});

And it works like a charm.

I guess you are using jQuery forms plugin. According to its documentation, this code :

$('#msform').ajaxForm(function() {
    // your options
});

should be placed in your outside of the submit function, just before for instance. Plus, you don't submit the form in your code. You should use this function in you submit function : $(this).ajaxSubmit();

So in the end, it should looks like this :

$(document).ready(function() {
    $('#msform').ajaxForm({
        // Callback called before the form loading.
        beforeSubmit: function() {
            $("#editjeeinde").hide();
            $("#loading").show();
        },
        // Success callback of your form.
        success: function() {
            $("#loading").hide();
            $("#done").show();
        }
    });

    // Change your submit function to load asynchronously your content.
    $('#myFormId').submit(function() {
        $(this).ajaxSubmit();
        return false;
    });
}