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

How to distinguish between two SUBMIT buttons_javascript skills

WBOY
Release: 2016-05-16 19:27:04
Original
1249 people have browsed it

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>
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template