question regarding the input tag

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?  My
question specifically centers around the use of a button input tag (e.g.,
<input type=”button” . . . />) where the intent is that no information is to
be sent to a server. Javascript sets up the “onclick” attribute, and control
stays local on the client (thus there’s no use for a form tag and its
“action” attribute.) The validator seems to endorse such a use – as in,

     <div id=’playingBoard’>

          <input type=”button” class=”square sqButton” />

            . . .

    </div>

The CSS class definitions define each input tag as a square and floats it
left to fill its container (the playingBoard.)



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. My question is this: which
interpretation of the use of the input tag is correct? Only within a form
tag, or is independent of a form tag OK?



I’ve attached a stripped-down version of my XHTML code and the associated
CSS file for your reference.



Thank you for your help.



John Holloway

Received on Thursday, 1 April 2010 13:44:31 UTC