multiple buttons on a form

前端 未结 6 801
遥遥无期
遥遥无期 2020-12-06 02:28

I have a clear button that I want to tie into some php coding. how do I detect if the clear button is pressed. When the user press clear, i\'m going to have it update a sql

6条回答
  •  旧时难觅i
    2020-12-06 02:59

    surprisingly, the formaction attribute was not covered. you can use it like so

    ...

    of course, this does not use javascript and has good browser support. this route (no pun intended) has the added benefit of not requiring extra if / then statements on the server since the same route won't be used for two different things

    reference https://css-tricks.com/separate-form-submit-buttons-go-different-urls/

提交回复
热议问题