Two submit buttons in one form

前端 未结 19 2057
不思量自难忘°
不思量自难忘° 2020-11-21 23:23

I have two submit buttons in a form. How do I determine which one was hit serverside?

19条回答
  •  别跟我提以往
    2020-11-22 00:17

    Simple you can change the action of form on different submit buttons Click.

    Try this in document.Ready

    $(".acceptOffer").click(function () {
           $("form").attr("action", "/Managers/SubdomainTransactions");
    });
    
    $(".declineOffer").click(function () {
           $("form").attr("action", "/Sales/SubdomainTransactions");
    });
    

提交回复
热议问题