How to use onsubmit() to show a confirmation if there are multiple submit buttons on the same form?

前端 未结 5 528
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-04 07:29
5条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-04 07:59

    Just use two of the same form. One for each button:

    
        
    
    
        
    
    

    Also, if you would done your research you would find these:

    • Javascript onsubmit with form with multiple submits buttons
    • HTML form with two submit buttons and two "target" attributes
    • Form onSubmit determine which submit button was pressed
    • How can I get the button that caused the submit from the form submit event?
      Two submit buttons in one form

提交回复
热议问题