Do i have to wrap every form element and its label in a block-level element in order for the code to validate? If so, which element should i use? div?
| SitePoint Sponsor |





Do i have to wrap every form element and its label in a block-level element in order for the code to validate? If so, which element should i use? div?

<fieldset>
And using only fieldset should suffice.
John Conde | Facebook | Twitter
Brainyminds Merchant Account Services I Love Code eBook Giant
Authorize.Net: AIM API | ARB API | CIM API Get the FREE code!
Merchant Accounts 101 | Ecommerce 101





So i shall do it with fieldset and hide the border with CSS, no?


A FIELDSET is meant for grouping related controls together. A FIELDSET must have a LEGEND as its first child. Sometimes I prefer to use a DIV instead, if I don't want borders and a legend. Especially for containing things like buttons.
Birnam wood is come to Dunsinane
Bookmarks