Html form - description and application

The html form is a special tool that allows you to make contact between visitors and authors. In the source code of the page, this tag is written as follows: <form>. In this article we will consider the contents of the form, the application and methods of sending information.

html form

Description

The <form> tag is included in all html specifications. At the moment, all modern browsers and platforms support this element. The html form is entirely aimed at exchanging data between users and the server. The simplest example of this element is filling out a questionnaire. Almost every user filled in information about themselves, for example, during registration. Similar profiles are created using the <form> tag. But it is worth noting that this element only sets the boundaries of the form and determines the method of sending data. And most of the content is set using <input> tags.

Form Settings

There are 8 special attributes for the <form> tag. One of the most important parameters is the "method". This attribute defines the method that will be used when submitting the form to the server. It has two values: get and post. The selection of the mandrel method depends on the contents of the form. The most commonly used value is get. There is a required attribute - "action". Its value should indicate the url of the executable application that will process the form. Typically, such a program is located on the site server. Without this attribute, the form is meaningless. By the way, you can do without using the application. Submission of the html form may occur via email. In this case, make the following entry: action = ”mailto: email address”. When the user clicks the "send" button, a list of tools that allow you to send emails will appear in front of him.

forms for html site

Form content

As mentioned above, forms for the html site most often contain various profiles, registration lists, surveys, etc. This content is generated using the <input> tag. This item has many different individual settings. The required <input> attribute is "type", which indicates the type of tag. This element most often generates various fields for data entry. For example: <input type = ”text” />. Such a record will create an area with the ability to insert text. There is a special value for the type = ”password” attribute, which allows you to safely enter a password or other important information (all characters will be hidden). Most often, the following two buttons are necessarily present on forms: submit and reset. They are indicated as the value of the type attribute. The first value means sending the form, the other is reset. The text inside the buttons can be changed.

submit html form

additional information

The html form can be styled using CSS. And most often this is exactly what happens. You can also create a form in the form of a table, then all the contents will be aligned at your discretion. You can use this item everywhere. It is not necessary to limit yourself by using a form to fill in data only. The <form> tag can contain an unlimited amount of information and content.

Conclusion

So, today you met the <form> tag. To fully understand its effect, it is necessary to try it in practice. If you do not have a server and a management application, then you can use the method with sending the form by e-mail. So you will understand the basic principle of this element. The html form is used on almost every site where developers want to create communication with their users.


All Articles