wsg  

RE: [WSG] Correct markup of fieldset

Paul Collins
Fri, 08 Aug 2008 03:31:28 -0700

Very good point Jens, I didn't realise my doctype was transitional. Sorted that 
now and the validation problems are there.

Yes, I think you're spot on there, most of the forms I have here are just for 
search, email signup, etc, so no reason I couldn't have them as part of the 
same fieldset.

Cheers
Paul



-----Original Message-----
From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Jens Brueckmann
Sent: Friday, August 08, 2008 11:00 AM
To: wsg@webstandardsgroup.org
Subject: Re: [WSG] Correct markup of fieldset

2008/8/7 Paul Collins <[EMAIL PROTECTED]>:
>
> This is one I've never been sure of; should the submit button be in a
> seperate fieldset, or should it even be in a fieldset at all because
> it is not a group  of fields; it's a button on it's own.
>
> For example:
>
> <form>
>     <fieldset>
>         <label>Search</label>
>         <input type="text" value=""/>
>     </fieldset>
>     <input type="submit"/>
> </form>
>
> As opposed to:
>
> <form>
>     <fieldset>
>         <label>Search</label>
>         <input type="text" value=""/>
>         <input type="submit"/>
>     </fieldset>
> </form>
>

Hi Paul,

in strict (X)HTML documents, the FORM element must only contain block elements 
[1].
Therefore, an INPUT element as a direct child of FORM would be invalid for 
documents with strict DTDs.

Using transitional DTDs, the FORM element may as well contain inline elements 
such as INPUT.

Apart from considering the validity of the markup in question, the complexity 
of the form could guide one. In your example with a single text input field one 
might view the submit button to be part of this same fieldset.
In more complex forms, e.g. a feedback form which requires input of name, 
e-mail, and a textarea for free text, the submit button would rather require 
its own FIELDSET or DIV or P parent element.

Cheers,

jens

[1] http://www.w3.org/TR/html401/interact/forms.html#edef-FORM
--
Jens Brueckmann
http://www.yalf.de


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************





*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************