October 20, 200818 yr Sup? I wanted to ask what method you prefer for structuring forms? I learnt CSS initially from the the APress book "Beginning CSS Web Development: From Novice to Professional", and it describes several methods: table, definition lists or standard paragraph/header formatting. The author tentatively suggests that in this instance, tables are a simpler way to control form layout. What say you?!
October 20, 200818 yr I would say I structure like this: <form action="email.php" method="post"> <label>Email:</label> <input name="email" size="30" type="text" /> <label>Message:</label> <textarea cols="40" rows="15" name="message"> </textarea> <input type="submit" /> </form>
October 20, 200818 yr I have only really tried one format using form, fieldset, legend, the inputs (whatever they may be), and I have used paragraphs and then css for layout. If I'm completely honest tho, it doesn't look exactly as I'd like.
October 20, 200818 yr Author JFTR - what I'm asking is how you style forms (i.e: do you tag form elements directly, or do you house them in another html element), not how to create the form itself.
October 20, 200818 yr Author er....nope - Okay let's rephrase the question one more time: By default, you are an advocate of semantic markup and use external CSS. Yet when it comes to forms, there are several methods with which you can structure your HTML document. You can use the bare form syntax, or you can house the form elements in side other html elements, such as a definition list, a table or paragraph/headers. for example - sitepoint has this tutorial that uses a table for layout: http://www.sitepoint.com/article/style-web-forms-css/3/ alistapart uses unordered lists http://www.alistapart.com/articles/prettyaccessibleforms and a whole bunch of other methods are listed here. http://www.smashingmagazine.com/2006/11/11...dern-solutions/
October 20, 200818 yr I wouldn't use tables. Lists seem to be popular but it doesn't seem semantic Perhaps just divs and fieldsets?? Depends on how complex the form is..
October 20, 200818 yr I think tables are the easy way to go, and despite being not semantic use of code, I wouldn't punish anyone for doing so. Having said that, I'm somewhat of a purist when it comes to doing things as they should be done, so for me its fieldsets, divs, what have you. It isn't easy to get right though.
October 20, 200818 yr Author I wouldn't use tables. Lists seem to be popular but it doesn't seem semantic Perhaps just divs and fieldsets?? Depends on how complex the form is.. That's why I ask the question, because the Apress book and author is most certainly pro standards/W3C/semantics, but shows three methods, of which one (and the one he appears to prefer) is table based. I thought - "that's odd".
Create an account or sign in to comment