The face of the web is changing, but are we keeping up with it? Forms are the basic unit of functionality, turning simple-looking web pages into feature-packed applications. But are we making full use of forms, pulling their full potential for making our users happy? This article describes a number of ways to customize web forms, to the ultimate goal of making users forget that they're using a form!
Good Form, Jack - You Gotta Have Class (Page 2 of 5 )
Humans have a funny tendency to enjoy an aesthetically pleasing environment. We acknowledge this when we put a great deal of effort into designing a fancy Flash splash intro for our web site and spend hours tweaking the global style sheet. So then how could we forget about forms, leaving them to their default, boring look? Yes, if we type in <input type=”text” />, we should get something that looks like this:
Now, I say 'should', because the rendering depends entirely on the client at this point. Yes, different browsers and even different operating systems will render the default input field how they see fit, or at least how their designers see fit. That's no good.
So when you're defining your global style sheets, don't leave out your input tags. You can create one style by defining the input tag style, but what I prefer to do is divide them out by type. I might create a class called input.textbox, and for text fields set the class=”textbox”. Generally I would redefine the default border and text family. Try this style on for size:
You'll find that this renders a much more crisp input box, that is consistent across your website. By the way, don't leave the size of the field up to the browser to determine. It is always a good idea to set the size attribute of an input field, but an even better idea to hard-code the width in pixels.