Using AutoComplete to Your Advantage

AutoComplete is a really clever little feature that makes automatic suggestions based on previous entries in text fields of web forms. It has excellent browser support, being enabled by default in almost all modern browsers (including even *gasp* IE6+, yay!) . And best of all, it requires almost no effort on your part to make it work!

In this entry, I will cover the basics of enabling AutoComplete for your web forms (it is really simple, trust me) and also provide some examples on how it is used on the web, since following de-facto standards is what makes AutoComplete tick.

Using AutoComplete to Your (and Your Users’) Advantage

Enabling AutoComplete for your site is simple. Just use common field names for your form fields and they will automatically make suggestions from all of the user’s previous entry for that field name, courtesy of the browser itself. The hard part is to know what those field names are.

Some of the most common field names for basic sign-up forms are:

  • “email”
  • “username”
  • “name” (contains both first name and last name)
  • “address1″
  • “address2″
  • “city”

Try them yourself by double-clicking in the form fields!

It probably goes without saying but AutoComplete doesn’t work with Flash form fields so if you can, avoid putting form fields in your Flash movies.

Turning Off AutoComplete for Your Forms

If the function of a field is really unique for your site, using a common field name will cause AutoComplete to suggest a bunch of unusable data to the user, possibly confusing her. To avoid this, use an unique field name for your unique field. That way, AutoComplete will only make suggestions particular for your site.

For example, you can add an extra character (“wusername”), add the name of your site to the name (“web_usability_username”) or use an uncommon abbrevation (“usrid”). Before you do this however, stop to think if this field really is unique. If your users are allowed to pick usernames themselves (highly recommended), they probably will pick the same username that they have on some other site so that field name shouldn’t be unique. If they have to use a username that you created for them, go ahead and make that field name unique.

You can also use the attribute autocomplete="off" (applied to your form or input element) to turn off AutoComplete for a field or the entire form, depending on which element you put the attribute in – form or input. This doesn’t validate however so use it with caution.

AutoCompleting Search Fields

The “Search” form field is probably the most commonly used form field on the web. As such, it demands a little special attention. Common field names for the search field include:

From that list, it is obvious that “q” is the consensus name for the search field and it is thus the recommended field name. The exception would be if your search has a very specific theme and the general content in the AutoComplete drop-down would confuse the user. And oh, 456 Berea Street also uses “q” if you need a little more web authority to convince you.

As a side note, Yahoo’s decision to use “p” is a little baffling. I guess they try to distinguish themselves from the rest of the pack (and probably Google in particular) but it probably hurts them (and their users) more than it helps.

OpenId – How to Set a Standard for AutoComplete

The OpenID Authentication Specification recommends that developers names the sign-in form field “openid_url” to enable AutoComplete. A recommendation like this is a great way to establish a kind of microformat that benefits the users greatly and therefore also the site owners. Most sites with OpenId follows this recommendation although some don’t. For instance, Jyte uses “openid_identifier” for some reason – their (and their users’) loss obviously.

Want More Technical Meat?

Check out Microsoft Developer Network for an indepth technical look into how AutoComplete works behind the scenes.

2 Comments »

  1. Jason Bartholme’s SEO Blog » Blog Archive » 101 Resources to Help You Build a Better Web Form - July 31, 2007 at 20:06

    [...] Web Usability Tech: Using AutoComplete to Your Advantage – webusability.se [...]

  2. Nalfurfarpfup - June 25, 2010 at 02:53

    Very Good site, thank yo mister, it’s help’s me!

Leave a Comment