Fine-Tuning Your Forms

Michael Adams, Webmaster

University of Northern Colorado

Structure your forms for better usability and display by using XHTML and CSS fieldset tags. Fieldsets can be very helpful and are easy to use.

Bonus: learn some general guidelines on how to organize your form information to make it easier for users to understand.

Second bonus: script automatic email(s) from a form that are much more useful for the recipient than name/value pairs.

What Is A Form?

 

Warning!

Unless sent through an SSL connection, forms are inherently insecure!

Of Labels and Fields

Of Formatting and Problems

Semantic markup allows a computer to parse the information into meaningful globs. The markup is descriptive of the content. Which description provided by the markup in the sample forms best describes a form?

Of Better Semantic Solutions

Example code

<fieldset><legend>What are your favorite things?</legend>
<label for="favorites">Kittens</label>
<input type="radio" name="favorites" value="k" />
</fieldset>

Of Possibilities and Flexibility

Of Styling Fieldsets et al

<style type="text/css">
   fieldset {width:60%;background: #FFFF99;padding 5px;
             border:4px outset #aaa;float:left;margin:20px;}
   fieldset fieldset {width:90%;background: #FFCC33;margin:10px 3px;
            padding:10px;font-size:80%;border:3px inset #bbb;}
   fieldset fieldset fieldset {width:60%;background-color:#33CCFF;
            border:2px solid #993300;font-size:110%;}
   legend {font-size:100%;font-weight:bold; text-transform:
            capitalize; background-color: #FFDD88;
            border:1px solid #333; border-bottom:none;}
   label {clear:left;width:15%;float:left;}
   label:first-letter {text-decoration:underline;}
   label.without:first-letter {text-decoration:none;}
   input, select {width:auto;float:left;}
   .clear {clear:both; margin:10px 0 5px 0; width:100%;}
</style>

Of Semantic Fieldsets

Of Real-World Examples

Here's my administrative functions menu (used by a couple of others as well)

Organizing Form Elements

Examples of Forms

Dealing with Information

Lessons Learned

Questions?