YouTip
Home
JavaScript
PHP
Python3
HTML
C#
Python
Java
PyTorch
Linux
C
jQuery
CSS
XML
jQuery UI
Bootstrap
C++
Angular
HTML DOM
Redis
Web Building
Home
>
HTML
>
Att Button Formmethod
Att Button Formmethod
π 2026-06-14 | π HTML
# HTML
formmethod Attribute The `formmethod` attribute of the `
` tag specifies the HTTP method used to send form-data to the server when the form is submitted. This attribute is highly useful because it allows a single form to have multiple submit buttons that send data using different HTTP methods, overriding the default `method` attribute defined on the parent `
` element. --- ## Definition and Usage * **Override Capability:** The `formmethod` attribute overrides the `method` attribute of the `
` element. * **Requirement:** The `formmethod` attribute can only be used with buttons where `type="submit"`. * **HTML Version:** This is a feature introduced in **HTML5**. ### HTTP Methods: GET vs. POST Form data can be sent using two primary HTTP methods: #### 1. GET Method (`formmethod="get"`) * Form data is appended to the URL as name/value pairs: `URL?name=value&name=value`. * **Size Limit:** The amount of data sent via GET is limited (typically around 2 KB) due to URL length restrictions. * **Security:** **Never** use the GET method to send sensitive information (such as passwords or credit card numbers), as the data will be visible in the browser's address bar, browser history, and server logs. #### 2. POST Method (`formmethod="post"`) * Form data is sent inside the body of the HTTP request. * **Size Limit:** There is no size limit for sending data via POST. * **Security:** It is much more secure and robust than GET because the submitted data is not exposed in the URL. --- ## Syntax ```html
Submit
``` ### Attribute Values | Value | Description | | :--- | :--- | | `get` | Appends the form-data to the URL: `URL?name=value&name=value`. | | `post` | Sends the form-data as an HTTP post transaction (data is sent in the request body). | --- ## Code Example Below is an example of a form with two submit buttons. * The first button submits the form using the default `GET` method defined in the `
` tag. * The second button overrides the default behavior and submits the form using the `POST` method to a different action URL. ```html
First name:
Last name:
Submit using GET
Submit using POST
``` --- ## Key Considerations & Best Practices 1. **Pairing with `formaction`:** As shown in the example above, `formmethod` is frequently paired with the `formaction` attribute. This allows you to not only change *how* the data is sent (GET vs. POST) but also *where* it is sent (e.g., sending a search query to a search page via GET, or saving a draft to an API endpoint via POST). 2. **Form Validation:** If you use `formmethod` to change the submission type, ensure your backend server is configured to handle both GET and POST requests on their respective endpoints. 3. **Semantic HTML:** Always explicitly set `type="submit"` on the `
` when using `formmethod`. If the `type` attribute is omitted, some browsers may default to `type="submit"`, but declaring it explicitly ensures consistent cross-browser behavior. --- ## Browser Support The `formmethod` attribute is widely supported across all modern web browsers: * Google Chrome * Mozilla Firefox * Microsoft Edge (Internet Explorer 10 and later) * Safari * Opera *Note: Internet Explorer 9 and earlier versions do not support the `formmethod` attribute.*
β Att Button Formnovalidate
Att Button Formenctype β
π Categories
β‘ JavaScript
(1589)
π PHP
(872)
π Python3
(810)
π HTML
(691)
βοΈ C#
(650)
π Python
(594)
β Java
(552)
βοΈ PyTorch
(534)
π§ Linux
(472)
βοΈ C
(432)
π¦ jQuery
(406)
π¨ CSS
(377)
π XML
(259)
π¦ jQuery UI
(231)
π― Bootstrap
(220)
βοΈ C++
(215)
π °οΈ Angular
(205)
π HTML DOM
(201)
π΄ Redis
(188)
π Web Building
(142)
π Vue.js
(141)
π R
(131)
πΌ Pandas
(124)
ποΈ SQL
(105)
βοΈ Docker
(86)
βοΈ TypeScript
(73)
βοΈ Highcharts
(70)
π AI Agent
(70)
βοΈ React
(68)
π Node.js
(65)
βοΈ Machine Learning
(60)
π Git
(59)
π΅ Go
(58)
π Markdown
(58)
π’ NumPy
(55)
π§ͺ Flask
(54)
βοΈ Scala
(53)
ποΈ SQLite
(52)
π JSTL
(52)
βοΈ VS Code
(51)
π MongoDB
(49)
π Perl
(48)
π Ruby
(47)
π Matplotlib
(47)
βοΈ Uncategorized
(46)
π Swift
(46)
ποΈ PostgreSQL
(46)
βοΈ Data Structures
(46)
π Playwright
(46)
π iOS
(45)
ποΈ MySQL
(44)
βοΈ LangChain
(43)
π FastAPI
(40)
βοΈ Ionic
(38)
π Design Patterns
(37)
βοΈ Eclipse
(37)
π¨ CSS3
(34)
π Lua
(34)
βοΈ Codex
(34)
πΈ Django
(32)
βοΈ OpenCV
(32)
π Rust
(31)
π JSP
(31)
βοΈ Claude Code
(31)
π Pillow
(30)
βοΈ OpenCode
(28)
π AI Skills
(27)
π Flutter
(26)
π Maven
(26)
π¨ Tailwind CSS
(25)
π§ TensorFlow
(25)
π Servlet
(24)
π Dart
(23)
π Assembly
(23)
βοΈ Memcached
(22)
βοΈ SVG
(22)
βοΈ Electron
(22)
π NLP
(22)
π Regex
(21)
π Android
(20)
π£ Kotlin
(19)
π Julia
(19)
π SOAP
(17)
π Selenium
(17)
π PowerShell
(17)
π Sass
(16)
π HTTP
(16)
π Zig
(15)
π AI
(15)
π AJAX
(14)
π Swagger
(14)
βοΈ Scikit-learn
(13)
βοΈ ECharts
(13)
βοΈ Chart.js
(13)
βοΈ Cursor
(13)
βοΈ SciPy
(12)
π RDF
(12)
π Ollama
(12)
π Next.js
(12)
π Plotly Dash
(12)
π JSON
(11)
π RESTful API
(11)
π WSDL
(9)
βοΈ CMake
(8)
π Firebug
(7)
π Nginx
(6)
βΈοΈ Kubernetes
(6)
π Jupyter
(6)
π LaTeX
(4)
π UniApp
(4)
ποΈ SQL Server
(1)