splorp / tersus

An achingly simple WordPress theme without all the usual cruft.
GNU General Public License v3.0
99 stars 6 forks source link

Use <fieldset> in Comment Form #26

Open splorp opened 12 years ago

splorp commented 12 years ago

The existing <p> elements wrapping form <input> and <label> pairs should be changed to use <fieldset> elements.

cdharrison commented 12 years ago

Wouldn't a <fieldset> typically have a group of <input> and <label> tags? Not sure if

<legend><label for="author">Name <?php if ($req) echo "(required)"; ?></label></legend>
<input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
</fieldset>```
would be proper... [This] (http://stackoverflow.com/questions/238996/wrapping-a-label-element-within-a-legend-element) argues it would be incorrect usage.
splorp commented 12 years ago

You’re right.

Looking at this again, my idea doesn’t make any semantic sense. I was trying to get away from adding more <div> or <span> noise in there, as paragraphs aren’t semantically correct either. At least using <div> or <span> is neutral.

Let me review some of Luke Wroblewski’s best practices and revisit this.

If nothing else, the groups of fields within the comment form should be wrapped in a <fieldset> with its own descriptive <legend>.