HTML forms

Greetings everyone,

I have noticed a lot of discussion about the different form 
implementations that are being proposed and I am sure they all have 
their merit and place however, after discussing some of the aspects of 
coding forms in HTML with a colleague I can surely all agree that this 
is one of the areas we all love to to hate. The ways we currently have 
to go about making forms look functional an usable is just not the way 
we want it to be.

We have to do all kinds of hacks and none of these are semantic 
solutions to get forms to display the way we want them to. I here 
propose a simple solution. The majority of users actually prefer having 
forms laid out as follows:

[  form element ]
[ form element]

This makes connecting the label to the appropriate field very easy on 
the eye as well as a host of other benefits like being able to add 
validation errors to the <label> tag without affecting layout(in general):
[ name]
surname: !you must provide a surname!
[ form element ]

So what do I propose? Make the <label> and form element tags block level 
elements so that form elements by default break to the next line instead 
of having to use the current hacks or using the <br /> tag to break to 
the next line.

I believe this will make default form layout a lot more effective and 
semantic while still allowing alternate layout of forms using CSS.

Look forward to your feedback.

Kind Regards
Schalk Neethling
The South African Web Standards and Accessibility Group

Received on Wednesday, 2 May 2007 22:06:29 UTC