Home  >  Article  >  Web Front-end  >  How to distinguish between two SUBMIT buttons_javascript skills

How to distinguish between two SUBMIT buttons_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:27:041221browse

There are two SUBMIT buttons (such as "Modify" and "Delete") in a FORM form, and only one ACTION processing page
How to distinguish whether to process "Modify" or "Delete" in this ACTION page?

Method 1:
If the FORM form is like this:





You The value of Request("Action") can be read in ASP. If the user selects "Modify", then this variable is "Modify".

Method 2:
can be a script function, such as:










This allows you to send multiple buttons to different web pages. <script> <BR>function modify() <BR>{ <BR>document.form1.action="modify.jsp"; <BR>document.form1.submit(); <BR>} <br><br>function delete() <BR>{ <BR>document.form1.action="delete.jsp"; <BR>document.form1.submit(); <BR>} <BR></script>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn