Might an input with the form attribute precede the form element in the document?

Viewed 56

In a generated page, it would be easiest if some of the inputs preceded the form definition. The form attribute seems to be the appropriate mechanism (eg <input form='f1' ...>. In the examples I found online, the form precedes the inputs, so I am wondering if it is OK for these input elements to precede the form in the document as in:

<input form='f1' type='text' name='i1'>
   ...
<form id='f1' action='...'>
<input type='submit' name='s2'>
</form>

In my (limited) testing this seems to work, but I can not find wording in the standard that requires it to work. In particular, the standard says:

If a reassociateable form-associated element has a form attribute specified, then that attribute’s value must be the ID of a form element in the element’s owner Document.

And at the time the input element is encountered in the document, there is (not yet) any such form. Am I reading this incorrectly?

0 Answers
Related