How to raise “completed” event on a submit event?

后端 未结 2 406
南旧
南旧 2021-01-25 10:52

The controller action is called after the completedCallback not after $(this).submit(). See the code below. How can i trigger the action before raising the completed callback wi

2条回答
  •  旧时难觅i
    2021-01-25 11:17

    Maybe your action can return a url var, like ?status=submitted?

    Then check in your javascript if that var exists and if so, trigger your completedCallback.

    By the way, you should return false in your $(form).submit(function(){return false;}); if you dont want the form to be submitted if flag == true.

提交回复
热议问题