Breaking down the controlsLet’s start by dividing them into two buckets, because some form controls have never been much trouble to work with.
Friendly controlsThe controls that are easiest to work with are the basic input box, text area and button. They work well with standard CSS and, fortunately, are the most common form elements. If you don’t need to use the more difficult ones, then you’re lucky. With the progress of CSS3 rounded corners, drop shadows and gradients, many of the most common styles are now even easier. You have nothing to fear with these controls.
Troublesome controlsCertain other form controls can be a massive pain in the neck. For example, if you design a drop-down control that is extremely stylized, the developer will likely want to have a chat with you. Your options for styling will be quite constrained: border color, padding, background color, that sort of thing. If you need more styling than this, I suggest you consult with the developer to ensure you’re not creating a major problem for them. Troublesome form controls include:
- select multiple,
- select drop-down,
- radio buttons,
- file upload.
Form control replacementIf you want to do some radical things to a form, helpful tools are available. A brilliant tactic for taming web forms is to hide the actual control and replace it entirely with a manufactured one. This gives you far greater control over how the form renders. One great example of this is Uniform, a jQuery plug-in for creating slick forms. It comes in three different themes. And if you want to create a custom theme, just use the service’s CSS generator to easily skin the plug-in. Another jQuery plug-in Niceforms. While it doesn’t have the handy re-skinning functionality of Uniform, it does offer a basic style that could very well fit your needs as is. Finally, there is the commercial jQuery extension Wijmo. The module we’re interested in here is the form decorator, which is actually free to use. It tackles a few of the more problematic controls: checkboxes, radio buttons and drop-downs. Being part of a larger commercial library, this tool brings some benefits, the foremost of which are strong documentation and paid support. Finally, I love the way it handles skinning; it uses the jQuery UI ThemeRoller, making easy work of custom designs.
Invented form controlsFinally, if there isn’t a form control that does what you need, you could invent one! Some very smart people have already done a lot of this, and perhaps one of their tools already fits your needs.
SlidersOne thing that is missing from standard HTML (but is a part of HTML5) is a basic slider control. There are many answers to this, including one from Wijmo, which is based on the jQuery UI slider.
UploadersWhile you could use the file input control to enable users to select a file for uploading, you might want something a bit snazzier, especially if file uploads are critical to your website. One of the best solutions is Uploadify. It allows users to select multiple files and to view progress. It comes with a variety of layout and functionality options.
Slider-style checkboxes and radio buttonsOne popular UI element (thanks to the iPhone) is the on/off switch that slides from side to side. With this handy jQuery plug-in, you can transform a basic checkbox or radio button into one. Whether you call this an invented form control or a form replacement tool, it is a great way to enable users to turn options on and off.
Creative buttonsjQuery UI is another interesting take on basic controls. What it labels as buttons could also be used to make option sets based on buttons, radio buttons and checkboxes. In doing so, you transform these controls into a different visual form. In the image below is a set of radio buttons styled as a row of buttons.
HTML5 FormsHTML5 has brought a lot exciting possibilities to web forms. While it is beyond the scope of this article, it’s still relevant. Here are some key resources to help you dig in:
- “A Form of Madness,” Dive Into HTML5;
- “Fun With HTML5 Forms,” Richard Shepherd;
- “HTML5 Forms,” Wufoo;
- “Have a Field Day With HTML5 Forms,” Inayaili de León.
Patrick McNeil is a designer, developer and writer; but above all things he is a passionate educator. He is a Professor of Graphic Design at the University of Missouri St. Louis where he focuses on teaching UX Design methods and front end development techniques. Patrick is also the author of the bestselling book series The Web Designer's Idea Book and the curator of DesignMeltdown.com. For more information about Patrick visit his personal site, pmcneil.com, or follow him on Twitter @designmeltdown.