HTML Guides for method
Learn how to identify and fix common HTML validation errors flagged by the W3C Validator — so your pages are standards-compliant and render correctly across every browser. Also check our Accessibility Guides.
The method attribute on <form> accepts only get, post or dialog, so an empty value or an HTTP verb like PUT or DELETE is invalid.
The keywords are case-insensitive, so POST and post both work, but the value must match one of the three exactly. Extra whitespace, as in method=" post", also triggers this error. dialog only makes sense for a form inside a <dialog> element, where submitting closes the dialog instead of sending a request.
Browsers fall back to GET when the value is invalid. An empty method="" often comes from a template that prints an unset variable. The form still submits as GET, so remove the attribute or write method="get". An unsupported verb causes a real bug: a form with method="PUT" or method="DELETE" sends a GET request with the field values in the URL, so the server's PUT or DELETE handler never runs.
HTML forms can't send PUT, PATCH or DELETE requests. Use method="post" and tell the server which verb you meant. Frameworks such as Rails, Laravel and Phoenix read a hidden _method field for this, or you can send the request with fetch() from JavaScript.
Empty value
Invalid example
<form action="/search" method="">
<label for="q">Search</label>
<input id="q" name="q" type="search">
<button>Search</button>
</form>
Valid example
<form action="/search" method="get">
<label for="q">Search</label>
<input id="q" name="q" type="search">
<button>Search</button>
</form>
Unsupported HTTP verb
Invalid example
<form action="/profile" method="PUT">
<label for="name">Name</label>
<input id="name" name="name">
<button>Save</button>
</form>
Valid example
<form action="/profile" method="post">
<input type="hidden" name="_method" value="put">
<label for="name">Name</label>
<input id="name" name="name">
<button>Save</button>
</form>
Validate at scale.
Ship accessible websites, faster.
Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.
1K Weekly
1,000 monthly checks. Cancel anytime.
Get 1K Weekly →Join teams across 40+ countries