Two submit buttons in one form

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

    Since you didn't specify what server-side scripting method you're using, I'll give you an example that works for PHP

    
    
    
    
    
      
      
    FORM-1 with 2 buttons
    FORM-2 with 1 button

    Forms

    When click on Login -> loginForm

    When click on Save -> saveForm

    When click on Register -> registrationForm

提交回复
热议问题