Two submit buttons in one form

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

    Since you didn't specify what server-side scripting method you're using, I'll give you an example that works for Python, using CherryPy (although it may be useful for other contexts, too):

    
    
    

    Rather than using the value to determine which button was pressed, you can use the name (with the

提交回复
热议问题