Forms are a major external form to implement dynamic web pages. Forms and form fields do not have the ability to type, and the production of form web pages must ultimately be organized by forms. html forms are an important means to interact with html pages and browsers. Use forms to collect relevant information submitted by the client.
When browsing a website, you often encounter forms, which are an important part of the website's interactive functions. No matter which form of language the website uses to implement the interactive functions of the website, such as asp, php, and jsp, forms have become their unified external form.
The main function of a form is to collect information, specifically the information of the viewer. For example, if you want to apply for an email online, you must fill in the form page provided by the website as required, and the main content is personal information such as name, age, contact information, etc. For example, if you want to speak on a forum, you must apply for qualification before speaking, and you must fill out a form page.
Forms can be used for survey, ordering, searching and other functions. A general form consists of two parts: one is the html source code that describes the form elements, and the other is the client's script, or the program used by the server to process the information filled in by the user. In html, we can define forms and cooperate with server-side form handlers such as cgi or asp.
The process of form information processing is: when clicking the submission button in the form, the information entered in the form will be uploaded to the server, and then the relevant applications in the server will process it. After the processing, either store the information submitted by the user in the server database, or return the relevant information to the client browser.
A form is a specific area on a web page. This area is defined by a pair of <form> tags. This step has several functions. First, limit the scope of the form. Other form objects must be inserted into the form. When you click Submit button, the contents that are submitted are also within the scope of the form. The second aspect is to carry relevant information about the form, such as the location of the script program that processes the form, the method of submitting the form, etc. This information is invisible to the viewer, but it does play a decisive role in processing forms.
The properties of the <form> tag are shown in the following table
| property | describe |
|---|---|
| name | The name of the form |
| method | There are generally two methods to define the method of transferring form results from the browser to the server: get and post |
| Action | Used to define the location (relative or absolute address) of form handlers (asp, cgi, etc.) |
| enctype | Set the encoding method of form data |
| target | Set the display method of return information |