8

I've just run a webpage of mine through the W3C HTML5 validator, and it validates completely, even though the form in it doesn't have an action attribute, which the HTML 4 validator always complains about. Considering the fact that the HTML5 validator is still experimental, is the fact that the form validating despite not having an action attribute a problem with the validator, or has the HTML5 spec changed to not require that attribute any more?

asdfasdf
  • 81
  • 1
  • 2

1 Answers1

14

According to the specification action is not mandatory:

The action and formaction content attributes, if specified, must have a value that is a valid non-empty URL potentially surrounded by spaces.

Although, section 4.10.1.3 Configuring a form to communicate with a server states that:

You also have to specify the URL of the service that will handle the submitted data, using the action attribute.

So, the specification says that if you want your form to communicate with a server it shall provide the action attribute. Which, in my opinion, is not the only truth as you can specify actions on buttons as well.

EDIT: I must admit that I can't finally answer your question with Yes or No...

home
  • 12,468
  • 5
  • 46
  • 54
  • 1
    You are correct. The `action` attribute is not mandatory. Note that the section 4.10.1.3 is marked *non-normative*, that is, the text is guidance, and does not itself impose any requirements. So your first quote is the relevant one. Good answer. +1 – Alohci Aug 13 '11 at 09:38
  • 2
    Is 'specifiction' a deliberate misspelling? ;) – robertc Aug 13 '11 at 21:05