On 5/27/07, Katrina <[EMAIL PROTECTED]> wrote:
In some sense, the label and input are thematically related.

Interesting idea, and in a way I agree. However I still think, in
combination with fieldsets and appropriate form elements, that a ul is
an appropriate way to mark up form controls. For example, I have
recently been marking-up forms roughly like this:

<form action="usercp.php" method="post">
        <fieldset>
                <legend>Personal Details</legend>
                <ul>
                        <li>
                                <label for="firstname">First Name</label>
                                <input id="firstname" name="firstname" 
type="text">
                        </li>
                        <li>
                                <label for="lastname">Last Name</label>
                                <input id="lastname" name="lastname" 
type="text">
                        </li>
                </ul>
        </fieldset>
        <fieldset>
                <legend>Contact Details</legend>
                <ul>
                        <li>
                                <label for="address">Address</label>
                                <input id="address" name="address" type="text">
                        </li>
                        <li>
                                <label for="city">City</label>
                                <input id="city" name="city" type="text">
                        </li>
                        <li>
                                <label for="postcode">Postcode</label>
                                <input id="postcode" name="postcode" 
type="text">
                        </li>
                        <li>
                                <label for="email">E-mail Address</label>
                                <input id="email" name="email" type="text">
                        </li>
                </ul>
        </fieldset>
</form>

To my way of thinking this is a semantically correct way of displaying
a form. I have a fieldset grouping related form controls. Inside the
fieldset I have a list of individual form controls. Makes perfect
sense.

In a way I could almost take Katrina's thinking a little further wrap
each fieldset in an <li> tag as part of an unordered list of
fieldsets, and insert an additional fieldset into each exisiting li.
Like so...

<form action="usercp.php" method="post">
        <ul>
                <li>
                        <fieldset>
                                <legend>Personal Details</legend>
                                <ul>
                                        <li>
                                                <fieldset>
                                                        <label for="firstname">First 
Name</label>
                                                        <input id="firstname" 
name="firstname" type="text">
                                                </fieldset>
                                        </li>
                                        <li>
                                                <fieldset>
                                                        <label for="lastname">Last 
Name</label>
                                                        <input id="lastname" name="lastname" 
type="text">
                                                </fieldset>
                                        </li>
                                </ul>
                        </fieldset>
                </li>
                <li>
                        <fieldset>
                                <legend>Contact Details</legend>
                                <ul>
                                        <li>
                                                <fieldset>
                                                        <label 
for="address">Address</label>
                                                        <input id="address" name="address" 
type="text">
                                                </fieldset>
                                        </li>
                                        <li>
                                                <fieldset>
                                                        <label 
for="city">City</label>
                                                        <input id="city" name="city" 
type="text">
                                                </fieldset>
                                        </li>
                                        <li>
                                                <fieldset>
                                                        <label 
for="postcode">Postcode</label>
                                                        <input id="postcode" name="postcode" 
type="text">
                                                </fieldset>
                                        </li>
                                        <li>
                                                <fieldset>
                                                        <label for="email">E-mail 
Address</label>
                                                        <input id="email" name="email" 
type="text">
                                                </fieldset>
                                        </li>
                                </ul>
                        </fieldset>
                </li>
        </ul>
</form>

Yes, it may be overkill (but then compound elements often seem
pointless until you look depper), but I think it's hard to argue the
semantic value of an unordered list when there are repeating elements
that have the same underlying purpose or meaning.

In reality there are a lot of ways that you could do this that make
sense on some level, and the fact that there is such a discussion
about this proves that this is an issue that is commonly faced, and I
find it interesting that there is currently no firm consensus on the
best way to create semantic meaning around form elements.

--
Australian Web Designer - http://www.blakehaswell.com/


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

Reply via email to