JQuery submit not working in Chrome

后端 未结 3 413
情书的邮戳
情书的邮戳 2021-01-20 00:25

Following is the form

@using (Html.BeginForm(MVC.CollectionPlanConfirmation.ActionNames.Edit, MVC.CollectionPlanConfirmation.Name, FormMethod.Post, new { @id         


        
3条回答
  •  滥情空心
    2021-01-20 01:06

    The best way to perform a submit for jquery is in this way.

    $('#submitButton').click( function() {
        $.ajax({
            url: 'some-url',
            type: 'post',
            dataType: 'json',
            data: $('form#myForm').serialize(),
            success: function(data) {
                 console.log("success");
            }
        });
    });
    

    http://jsfiddle.net/BD3Rt/

    Always nice to keep html clean and separate your jquery/javascript code.

提交回复
热议问题