Risk sounds like a fool. The html (html5) designers in our company continue to pass me functional layouts with form tags that have no attributes ...
<form>
<label for="name">Name</label>
<input type="text" id="name" name="name">
</form>
Every time I see this, I lose hope for humanity a little more. But I don’t know if I should go around all of them and read them on the attributes of the form and why we need them, because I can’t find the documentation that says they are “required”. By default, I know that a form tag will accept things like method and action, but I prefer these attributes to be in place rather than omitted. This is exactly what has always been for those of us who have written HTML from the very beginning.
So, the general question is: is something wrong (but you want to define it) using a form tag with no attributes? If your proposed action is the current page and the method is get, then what argument is there to enable and exclude default attributes? Or assign it an identifier that you are not using?
I expected to see this:
<form id="search_form" action="" method="get">
<label for="name">Name</label>
<input type="text" id="name" name="name">
</form>
source
share