The most common, most commonly used and most common method is to use submit type. Look at the code:
In addition, another common method is to use pictures:
The third way is to use a link to submit the form, using the javascript DOM model:
This method actually calls a javascript function and uses the javascript function to submit the form. There are many and very flexible methods. For example, you can add it to the onclick event of any tag:
But what if there are multiple submit buttons in a form?
For example, the submit buttons in a form point to different processing pages. Since the form data processing page has been determined when the form is defined, simply placing multiple submit buttons in the form cannot achieve the purpose. of. This requires javascript.
First define a function:
< ;script language=javascript>
function query(){
form.action=”query.php”;
form.submit();}
function update(){
form. action="update.php";
form.submit();}
Change the action attribute value of the form through javascript, so that multiple submissions can be achieved The buttons have different functions. The code on the page is as follows:
The above code uses an ordinary button, and the submission function is implemented by calling the javascript function in its onclick event.
With the above methods of submitting the form, I think it is almost enough to cope with the complexity. form.
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