tersus icon indicating copy to clipboard operation
tersus copied to clipboard

Use <fieldset> in Comment Form

Open splorp opened this issue 14 years ago • 2 comments

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

splorp avatar Dec 11 '11 18:12 splorp

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.

cdharrison avatar Dec 22 '11 20:12 cdharrison

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>.

splorp avatar Dec 23 '11 03:12 splorp