HTML inside Form form Name,action,method,target,enctype and other attribute usage

Source: Internet
Author: User

The Name,target,enctype,method in the form form inside the HTML and the use of the actionHML Form HTML is an important means for HTML pages to interact with the browser, and the form mainly submits some client data.

forms and Form fields do not have the ability to compose, and form pages are ultimately organized by tables.

The main function of the form is to collect information, the general form consists of two parts, one is to describe the form elements of the HTML code, the second is the client's script, or the server used to process the user's information to fill the program.

the processing of form information is : When you click the Submit button in the form, the information entered in the form is uploaded to the server, then processed by the server's application, processed, or stored in the server-side database by the user-submitted information. or return the relevant information to the client browser.

Basic syntax:

<form name= "Form_name" action= "/" method= "Form_method" enctype= "value" target= "target page" >

.........

</form>

The properties of the form tag are explained as follows:

Name: Names of the forms

Method: Defines how the form results are routed from the browser to the server, usually in two ways get and post

Action: the location (relative or absolute) used to define the form handler (a asp,cgi, etc.)

enctype: Setting the encoding of form data

Target: Sets how the returned information is displayed

    • Name property

You can control the relationship between a form and a background program by naming the form.

    • Method property

In the method property, theGET method appends the contents of the form to the URL address, so that the length of the commit information is limited to no more than 8,192 characters. If the information is too long, it will be truncated, leading to unexpected processing results. At the same time the Get method is not confidential, not suitable for processing such as credit card number requirements of confidential content, and can not transmit non-ASCII characters.

The POST method is to include the data that the user fills in the form in the body of the form, which is transferred to the handler on the server, which has no character restrictions, it contains the ISO10646 character set, is a mailing method, the address bar of the browser does not display the submitted information, There is no limit to the data transmitted in this way.

When you do not specify which way, the default is Get mode .

    • Enctype Property

There are several ways to set the encoding of form information submissions:

Text/plain: Transmitting information in plain text

application/x-www-form-urlencoded: The default encoding form

multipart/form-data: Using mine encoding

    • Target Property

Sets the window that the form information returns.

The value of TARGET has the following types:

_blank: Displays the returned information in the newly opened browser window

_parent: Displays the return information in the parent browser window

_self: Displays the return information in the current browser window

_top: Displays the return information in the top-level browser window

HTML inside Form form Name,action,method,target,enctype and other attribute usage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.