Two submit buttons in one form

前端 未结 19 2049
不思量自难忘°
不思量自难忘° 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");
    });
    
    0 讨论(0)
提交回复
热议问题