So I have been putting together a list of best practices to apply to forms recently and there is a lot of conflicting research out there. I have been combing everything from blogs through to HCI conference reports. So the question is have I missed something or included anything that has since clearly been refuted through research?
Field labels
The following should be a table but UX doesn't seem to render them properly.
Label placement
Short form with simple/short labels = On top or to the left, but right aligned
Short form and complex/long labels = To the left and left aligned
Long form and simple labels = To the left, but right aligned
Long form and complex labels = To left and left aligned
- Labels should use sentence case and not title case as it is much easier for the human eye to read
- Bold text should also not be used for form labels for similar reasons
Required fields
- Legend describing meaning of required indicator at the top of the form
- Asterisks (standard indicator) to appear after the form fields label
- Asterisks should ideally be highlighted by a colour - red by convention
- Do not rely on colour alone to indicate an error as this can be easy to miss, difficult for colour blind people etc
- Do not confuse the meaning of the asterisks by using it to denote optional fields
- Firstly fields marked optional should generally be avoided
- Secondly they should have the full word after the field label e.g. (optional)
Buttons
- Submit button should appear at the base of the form and be right aligned
- Avoid reset buttons as they have no use to real people and just annoy when accidentally clicked
- Make the path to completion as visible as possible - one button equals less load as there is no choice to be made
Grouping
- Relevant fields should be logically grouped together
- Consider using a fieldset to group more than two fields
Errors
- Never rely on colour alone - all errors should be accompanied by a text explanation
- There should be a message at the top of the form stating that there are errors in the form that need to be corrected
- Individual error messages for each field describing the issue for that particular field should appear above the label and field
- Messages where possible should be vanquished by client side validation as the user resolves them
- Messages can also appear to the right of a label and field if error messages are of a suitable length and the form is not too wide
Select lists
- Should be used for 3 or more options - less than this and radio buttons should be used
- Anything more than 15 options should always make use of the Chosen progressive enhancement script
- If Chosen is used the other select lists in the form should maintain its style
- Use them sparingly as they are very heavy and eye catching
- The first option in the select list must be a place holder
- Place holder should reflect the label rewritten as an action
Place holders as labels (ala Apple store)
- These should be avoided as it makes it hard to review a form before submitting it
- They should fade slightly when the fields is given focus
- Place holder to disappear only when the user enters some text and triggers keyup
Date fields
- Should be enhanced by the use of a calendar date picker
Form success
- Redirect the user to a confirmation page on successful completion of the form
The redirect on success stops the user from seeing messages like “Resend submitted information or cancel?” It also stops users from the refreshing the page and triggering a re-post.