sending form's submit button's value?

后端 未结 3 1405
抹茶落季
抹茶落季 2021-01-19 21:19

I was wondering if it is possible to place 2 submit buttons if send either of its information when click.

Example:

 
相关标签:
3条回答
  • 2021-01-19 21:39

    Just set them both to type="submit". It will already do that.

    0 讨论(0)
  • 2021-01-19 21:41

    Remember, hitting enter on the form is like clicking on the submit button that appears first in your source.

    0 讨论(0)
  • 2021-01-19 21:50

    Given your code there, if you change the ignore button to be type="submit" then it'll do what you want.

    In the POST, you'll see this:

    // if Confirm clicked:
    REQUESTID -> requestId
    BYID -> byId
    TOID -> toId
    respond -> Confirm
    
    // if Ignore clicked:
    REQUESTID -> requestId
    BYID -> byId
    TOID -> toId
    respond -> Ignore
    
    0 讨论(0)
提交回复
热议问题