Drupal Forms User Guide

Introduction

This user guide sets out to explain the process of designing good forms with Drupal Forms.

Whether you're migrating an existing form or creating a new one from scratch, it's advisable to follow the process of Design, Build, Test.

Design

Do not be tempted to rush into building a form, thinking it's a straightforward task. It rarely is. 

The most important thing is to take your time. Designing good forms requires thought and consideration. Even short forms can benefit from stepping back to think them through.

Careful consideration must be given to:

  • the purpose of the form
  • who will be filling the form in
  • who will be processing the information, once the form is submitted

Make use of tools like Microsoft Whiteboard or a flowcharting package to ensure a form flows, especially if you start introducing conditions and logic into the mix. Even for simple forms of a few pages, sketching out the flow of a form so you can see the whole thing in one view reveals opportunities for improvements and flaws in existing designs.

Build

All forms are different. Even if, on the surface, the form might seem similar to an existing one, the user purpose may differ, and the team behind it will have different needs and processes. Make sure you have clearly identified everything you need to know before you start building. Changing forms mid-build is often more laborious than starting again. 

While there are a lot of rules set out in this guide, not all of them will apply all of the time. Always apply common sense.

Familiarise yourself with the various elements available to you. We've provided examples and notes on the most common ones, and those less regularly used, but with useful properties for specific circumstances. Often, there is more than one option, so make sure you consider which is the best one for your needs.

Test

Always make sure you test a form thoroughly with fellow forms designers, your stakeholders and the wider community of the web team and beyond.

If you have any questions on any aspect of building forms, contact Lucy Tann or Andy Coughlan.