Submit action getting hit twice while using JQuery UI Dialog

后端 未结 3 676
花落未央
花落未央 2021-01-15 08:01

I am writing an ASP.NET MVC 4 application using JQuery and bootstrap.

There is a modal dialog functionality in my site which used to work smoothly until recently whe

相关标签:
3条回答
  • 2021-01-15 08:28

    I fixed this issue by changing jquery.unobtrusive-ajax.js file to skip async call if the submit button is having a particular custom attribute.

    0 讨论(0)
  • 2021-01-15 08:36

    It sounds like you may be submitting the form once from your script, and then again due to the browser's default behavior. Try adding this to the top of your handler:

    event.preventDefault();
    
    0 讨论(0)
  • 2021-01-15 08:43

    You change you input type="submit" to input type="button"

    Here you are submitting your form twice, one by default behavior of form and another from script

    0 讨论(0)
提交回复
热议问题