


Summary of several submission methods of html forms_HTML/Xhtml_Web page production
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.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



In this article, we will learn how to allow multiple files uploads in HTML forms. We use multiple attributes to allow multiple file uploads in HTML forms. Several properties are available for email and file input types. Ifyouwanttoallowausertouploadthefiletoyourwebsite,youneedtouseafileuploadbox,alsoknownasafile,selectbox.Thisiscreatedusingthe<in

html2pdf is a JavaScript package that allows developers to convert html to canvas, pdf, images, and more. It takes html as parameter and adds it to pdf or desired document. Additionally, it allows users to download the document after adding html content. Here we will access the form and add it to the pdf using the html2pdfnpm package. We will see different examples to add form data to pdf. Syntax User can follow the following syntax to pass html form data as text and send it to html2pdf. varelement=document.getElementById('form');html2

PHP file upload tutorial: How to use HTML forms to upload files In the process of website development, the file upload function is a very common requirement. As a popular server scripting language, PHP can implement the file upload function very well. This article will introduce in detail how to use HTML forms to complete file uploads. 1. HTML form First, we need to use an HTML form to create a file upload page. In the HTML form, the enctype attribute needs to be set to "multipart/form-

How to handle HTML forms using Java? HTML form is one of the commonly used interactive elements in web pages, through which users can input and submit data. Java, as a powerful programming language, can be used to process and validate HTML form data. This article will introduce how to use Java to process HTML forms, with code examples. The basic steps for processing HTML form data in Java are as follows: monitor and receive POST requests from HTML forms; parse the parameters of the request; process data according to needs

In web development, it is often necessary to use regular expressions to match strings. In HTML, the form tag is a very important tag, so if we need to get all the form tags in the page, then regular expressions become a very useful tool. This article will introduce using regular expressions in PHP to match all form tags in HTML. 1. The form tag in HTML The form tag is a very important tag in HTML. It is used to create forms. The form is used

Ajax submission methods include GET submission, POST submission, PUT submission and DELETE submission. Detailed introduction: 1. GET submission is a common submission method. It appends form data to the URL and uses Ajax to send the request. GET requests are suitable for small data amounts because they can be recorded in the browser history. cache, and can share links between multiple pages; 2. POST submission is a more common submission method, by including form data in the request body and sending it using Ajax, etc.

To learn the five common submission methods in Ajax, specific code examples are required. Introduction: With the development of web applications and the increasing user demand for interactivity and real-time, Ajax technology has become an indispensable part of front-end development. Ajax (Asynchronous JavaScript and XML) is a technology that uses JavaScript for asynchronous communication. It can interact with the server's data and update the page content without refreshing the entire page. In Ajax

In web development, Ajax is already a widely adopted technology. Simply put, Ajax initiates an asynchronous request through JavaScript and updates partial content of the page to achieve a refresh-free effect. However, Ajax request methods are not limited to GET and POST. Today, we will take an in-depth look at the five submission methods of Ajax and provide specific code examples. GET request GET request is the most common Ajax submission method. it will data
