Two submit buttons in one form

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

    There’s a new HTML5 approach to this, the formaction attribute:

    
    
    

    Apparently this does not work in IE9 and earlier, but for other browsers you should be fine (see: w3schools.com HTML

提交回复
热议问题