Do I need all of this in <form>?


  1. that link clearly states the document is a draft. Lets see of they still say the same thing in a few years when html5 is finalised.

  2. you seem to be picking and choosing from that link whatever suits your opinion. On the one hand you say the html5 guys are probably wrong in using a <p> but they are correct in not using a <ul>. You can’t have it both ways because if they are wrong to use a <p>, who’s to say they are then not also wrong in not using a <ul> ?

If you try to use that argument then obviously the point they are making is that they are then also not whatever you feel would be better. Again, you can’t have it both ways.

Like I said, as long as the document validates with a Strict doctype, then whether you use a <p>, <ul>, <table> or whatever in this sort of case comes down to personal opinion and interpretation.

No, I didn’t mean to say they were wrong in using P. I said HTML5 “differs” and even noted it was a “possible future” as you’ll also be aware term paragraph doesn’t explicitly mean P only either in the HTML5 draft.

The OP was using XHTML and not h5 hence why I was comparing and contrasting. Sorry, I didn’t make that part clear enough maybe my dyslexic grammar tangled how it read? Also I had a damn glitch in connection [edit] was knocked out - it was supposed to be on another paragraph relating to the markup, i.e. the XHTML 1.x it was meant to read.

I don’t personally think P would be the best option either [for your form] though nonetheless point conveyed those form items are not really lists [in HTML5 either].

Does that read better perhaps not? What I was trying to write is forms can be diverse and generic values like ‘username’ and ‘email’ are different entities an; ‘email’ input is not usually the same as ‘gender’ or ‘age’ in most cases.

Let’s look at validation all that says is how the XHTML conforms to the DTD. Theoretically you can markup a whole page (main content - before we get any wisecracks) in multiple H6 if you so desired. Perhaps many ADDRESS elements if you really wanted and it would be valid but not usually best practice for most content yes I agree with that.

What do you think? :smiley:

<table>
	<caption>It's a list of lines of a list of data items. Yeah.</caption>
	<ul>
		<li>
			<tr>
				<ul>
					<li>
						<th>Head 1</th>
					</li>
					<li>
						<th>Head 2</th>
					</li>
					<li>
						<th>Head 3</th>
					</li>
					<li>
						<th>Head 4</th>
					</li>
				</ul>
			</tr>
		</li>
		<li>
			<tr>
				<ul>
					<li>
						<td>data 1</td>
					</li>
					<li>
						<td>data 2</td>
					</li>
					<li>
						<td>data 3</td>
					</li>
					<li>
						<td>data 4</td>
					</li>
				</ul>
			</tr>
		</li>
		<li>
			<tr>
				<ul>
					<li>
						<td>data 1</td>
					</li>
					<li>
						<td>data 2</td>
					</li>
					<li>
						<td>data 3</td>
					</li>
					<li>
						<td>data 4</td>
					</li>
				</ul>
			</tr>
		</li>
		<li>
			<tr>
				<ul>
					<li>
						<td>data 1</td>
					</li>
					<li>
						<td>data 2</td>
					</li>
					<li>
						<td>data 3</td>
					</li>
					<li>
						<td>data 4</td>
					</li>
				</ul>
			</tr>
		</li>
	</ul>
</table>

:karate:

Fair enough, but all you are doing is basically confirming that in the op’s case how you markup the form is open to interpretation and personal opinion. As long as the html validates with a Strict doctype then structurally it is fine. What is then “best practice” can be argued ad infinitum and in many cases comes down to a consensus on various opinions.

There is no-one who has the authority to enforce anything being done in any particular way :), given that all we have to guide us are a set of non-enforceable recommendations from the w3c.

So over the holidays I took advantage of the site point book deals and read most of the books relating to css including Fancy Forms Design(FFD). Maybe they slipped in an update but it appears (contrary to a previous post) that the authors of FFD advocate grouping related labels/inputs with a div.


<form action="#" method="get">
  <fieldset>
    <!-- Email -->
      <div>
        <label for="email">Your email address</label>
        <input type="text" name="email" id="email" />
     </div>

Oddly enough, while the authors discuss alternatives to using a div (i.e. assorted list options) they don’t come out and say why a grouping is useful.
Their css selectors look like ‘fieldset div’ ‘fieldset div label’ ‘fieldset div input’ etc. And of course like all css gurus they have all kinds of floats and clears and stuff like that tossed around.

To group or not to group? That’s my question.

Honestly, I too used to see list in everything. And since you cant put a lable or input as a direct child of a form, list seemed reasonable, as a novice. Sometimes the extra hook can even come in handy.

I stopped using lists, however, when it was made clear that a form doesn’t PRESENT a list. you aren’t listing info, you are requesting it. Think of it this way… how do you differentiate between UL and OL? The answer is when the ORDER is semantically necessary. But since you are just collecting info ( via the form) and it is submitted all at once and then parsed by VALUE PAIRS… an OL can never be discerned or never needed. IF the list cannot be discerned as an OL or UL ( no UL is not ‘default’) then it’s really not a list.

As such, I favour DIVs ( to replace the LIs) and FIELDSETs( to replace the UL…and only when needed) as they give me the same styling sensibilities and are more semantically accurate.

Just something to ponder.

I agree completely.