Just looking through my archives for some info on forms and found this. I am wondering about the use of the legend tag in the first example (http://www.amonline.net.au/sand/using/survey.htm) to set out the question. Would this be better suited/more semantically correct in the label tag? I guess I am trying to figure out the exact role of the legend tag and if it is describing the structure/grouping of the questions rather than the questions themselves?
Any comments? James -----Original Message----- From: russ weakley [mailto:[EMAIL PROTECTED] Sent: Thursday, 25 September 2003 2:01 AM To: Web Standards Group Subject: Re: [WSG]Tables or DIVs / Spans? Hi Beau, Where possible I'd try and go for non-tables, and use standard form elements and form-accessibility elements in conjunction with CSS to control the visual layout of a form. This means that "fieldsets" could be used to contain each question block, and "legends" as the form questions. The hidden ones would include "id" and "label for". Here is one example I did a while ago with all style controlled by accessibility elements (it looks at little wide on a full page as it is designed for a popup window - it is set to flow out to width of containing box): http://www.amonline.net.au/sand/using/survey.htm Another even simpler (and older) example is where spans can be used to position the elements so they can control the width of elements so they line up as if in a table (but without all the extra code): http://www.hhmc.com.au/downloads/index.htm This second form example above uses 3 paragraphs, and the questions are set within spans set to specific widths - pushing them out to line up with each other down the page. If I were to do that form now I'd use labels or standard form elements to do the job so no spans were required - semantically more pure. Having said all that, I'm sure there are complex forms where it would be harder to simple use standard accessibility elements or form elements as the basis for CSS controlled layout - divs or simple containing tables may have to be used. One quick comment about the first example above is that using "fieldsets" and "legends" forced me to lay out the form in a simpler, cleaner manor. This made the table easier to use for normal vision users as well. The visible containers (which are actually containers to help blind users) helped to contain each question for those with vision as well. What do others think? Russ > Hi all, > along a simliar vein to this question, how's this one; > > If you are designing a form/survey, would you also go for a table? It's not > *really* tabular data, you are using the table for layout/perhaps grouping > of elements more than anything. > > I know we should be using things like fieldsets, tab order, labels and all > other wonderful form elements like that, but they are also compatible with > tables (except perhaps fieldsets to some extent...), but what's the verdict > about the overall layout? > > I know some forms are easily re-designed to avoid tables, but others would > really struggle without some sort of rigid, grid-based layouts. > > Where do we sit on this one? > > Personally, I think I'd go for a table-based design if the layout was > particularly complex or I thought it required it, but I'd attempt to > redesign the form (if that was an option) so that this wasn't necessary. > > Beau ***************************************************** The discussion list for http://webstandardsgroup.org/ ***************************************************** ***************************************************** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help *****************************************************