Re: question regarding the input tag

JOHN HOLLOWAY wrote:

> Is it a correct interpretation of the XHTML 1.0 standard (using STRICT
> validation) that the input tag can be used outside of a form (<form>)
> tag?

Yes.

The general idea is that input elements normally appear inside form 
elements, and it is wise to put them there even if the elements are 
JavaScript-driven. The reason is that by putting them in a form element and 
by setting up a suitable server-side form handler, you can create backup 
processing of data, for situations where client-side scripting is disabled. 
(This is sometimes impractical, admittedly.)

However, such ideas have not been enforced in the form syntax (or even 
presented in prose requirements). An input element may appear wherever text 
is allowed.

> The more current browsers (e.g., Firefox 3.6.x) seem to handle the
> code as I had expected/hoped; while IE 6.29.x seems to require that
> the <input> tags
> be enclosed within a <form> tag in order to correctly process the
> code, even with a DOCTYPE specifying  xhtml 1.0  STRICT.

I haven't seen browsers require such things (and you might ask about this on 
some other forum, providing a URL of a demo), but that would be outside the 
scope of validation. Despite all the misleading propaganda, validation by 
means guarantees that the code works across browsers, or is "interoperable". 
(It might make it more probable, for some values of "probable".)

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 

Received on Thursday, 1 April 2010 16:42:19 UTC