...

View Full Version : Validation



j05hr
12-16-2009, 11:52 AM
How would you validate this in xhtml strict? I had a look on google but everyone seemed to be doing it the exact same way.



<label for="contactYou" class="fixedwidth">Best way to contact you?</label>
<select name="contactYou" id="contactYou">
<option>Home</option>
<option>Work</option>
<option>Mobile</option>
</select>



Error Line 111, Column 28: document type does not allow element "label" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

<label for="contactYou">Best way to contact you?</label>

Thanks,
Josh

_Aerospace_Eng_
12-16-2009, 12:08 PM
Those elements need to be inside of a fieldset or paragraph element. A fieldset is probably most semantic. You could use a paragraph but that won't really be semantic. Neither will the other elements.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum