--- url: "https://web.dev/learn/forms/form" titulek: "The form element in-depth | web.dev" h1: "The form element in-depth Stay organized with collections Save and categorize content based on your preferences." popis: "Learn all about the form element, when you should use a form, and how a form works in detail." jazyk: "en" kanonicka: "https://web.dev/learn/forms/form" drobecky: ["web.dev", "Resources", "Forms"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 00:05:03" znaku: 6086 slov: 921 kodovani: "iso-8859-2" sha256: "39bd6f8a58a064fa210a10d60b13c61a4d2f90f94609bf71de90a957b2bad4be" --- The form element in-depth Stay organized with collections Save and categorize content based on your preferences. In a previous module, you learned [how to use the `
` element](/learn/forms/form-element). In this module, you learn how a form works, and when to use a form. Should you use a `` element? Browser Support 1 12 1 1 [Source](https://developer.mozilla.org/docs/Web/HTML/Reference/Elements/input) You don't always need to put form controls in a `` element. For example, you might provide a `
` How does form submission work? When you submit a `
`, the browser checks the `` attributes. The data is sent as a `GET` or `POST` request according to the `method` attribute. If no `method` attribute is present, a `GET` request is made to the URL of the current page. How can you access and process the form data? The submitted data can be handled by JavaScript on the frontend, with a `GET` request, or by code on the backend, with a `GET` or `POST` request. Learn more about [request types and transferring form data](/learn/forms/form-element#where_is_the_data_processed). When the form is submitted, the browser makes a request to the URL that is the value of the `action` attribute. In addition, the browser checks if the **Submit** button has a `formaction` attribute. If this is the case, the URL defined there is used. Furthermore, the browser looks up additional attributes on the `` element, for example, to decide if the form should be validated (`novalidate`), autocomplete should be used (`autocomplete="off"`) or what encoding should be used (`accept-charset`). [Try to build a form](https://codepen.io/web-dot-dev/pen/c7d89671f738240187a86cda1074d554) where users can submit their favorite color. The data should be sent as a `POST` request, and the URL where the data is processed should be `/color`. Show form One possible solution is using this form:
Ensure users can submit your form There are two ways to submit a form. You can click a **Submit** button or press `Enter`, while using any form control. Always use actionable language when creating your **Submit** button. For example, **Proceed to payment** or **Save changes**. This helps your users understand the next steps of your form. You can add a **Submit** button in various ways. One option is to use a `