Two submit buttons in one form

前端 未结 19 2102
不思量自难忘°
不思量自难忘° 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:10

    You can also use a href attribute and send a get with the value appended for each button. But the form wouldn't be required then

    href="/SubmitForm?action=delete"
    href="/SubmitForm?action=save"
    

提交回复
热议问题