the perfect form
Whether its filling out a job application, or signing up to create a new email account, we all encounter forms in one way or another. If you’re anything like me, entering information on forms can be quite tiresome, especially if its the same details each time i.e name, email address, password yada yada yada. However, just like pairing up socks after getting them out of the washing machine, its something we just have to do.
As it seems we cannot avoid encountering an online form, there is a very good argument here, that online forms should be well designed, easy to use, help me (where possible) fill in the form and let me know that I have made a mistake in a nice friendly way.
Good HTML Structure
This is important for getting the design of forms right. A good bare bones structure, will give you a good start, and also prevent problems occurring down the line when adding CSS or JavaScript.
A nice basic structure for a sign up form can be found below:
<form id="signupform" action="index.html" method="post">
<fieldset>
<legend>Sign Up Form</legend>
<label for="name">Name</label>
<input id="name" name="name" size="30" type="text" />
<label for="email">Email</label>
<input id="email" name="email" size="30" type="text" />
<label for="password">Password</label>
<input id="password" name="pasxword" size="30" type="password" />
<label for="submit"></label>
<button id="submit">Send</button>
</fieldset>
</form>
Once this basic structure is in place, it is quite easy to apply CSS to the form using the ID attributes on the various elements. You can also use these ID’s for JavaScript to reference, rather than use in-line JavaScript.
When fields are highlighted these should stand out to give the user a good visual aid. This will inadvertently speed up the process of filling out the form.
Validation
I find it annoying when forms that have mandatory fields are indicated by an asterisk (*). Whilst this isn’t such a good practice if a user requires the use of a screen reader, I often miss them completely. If something is so important, why not make these fields stand out? I find that a simple “Required” works 10 times better than a *. Taking this one step further, instead of just using required, why not customise each one for the field it is linked to? For example, a password field may have a validation message “Please use 6-10 characters using only letters or numbers”
I also find it quite irritating when I fill out a form and submit it, only to find that I missed out required fields. It can be really handy and save a lot of frustration if fields are validated as you move from one field to another. This can easily be achieved by changing the “Required” message to a “Input Valid” message or even using a relevant image.