Forms

The problem: asking people for information is where most apps lose them. Long, unclear or unforgiving forms get abandoned or filled in wrong.

The solution: ask only for what you need, in an order that makes sense, with clear labels and errors that say how to fix them. Build the form with eds-form, which handles layout, validation and errors in the EBRAINS style. Its page documents field types, validation rules, conditions and events.

Ask for less

  • Remove every field you can’t explain a use for. Each one costs completions.
  • Don’t ask for what you already know: prefill it from the signed-in user (init-data).
  • Make fields optional only if you really can do without them; if most are optional, ask whether they belong at all.

Structure the form

FieldsStructure
Up to about 6One column, no sections
6–15, in clear topicsSections with headings (groups)
Long, or with stages that depend on earlier answersSeveral steps (eds-steps-v2), one topic per step
  • One column. Side-by-side fields get skipped. Exceptions: short related pairs such as first and last name.
  • Natural order: who you are, then what you want, then the details.
  • Show only what applies. Use conditional fields (condition) instead of “If you answered yes above…”.

Write labels and help

  • Every field has a visible label, above the field. Placeholders are not labels: they vanish while typing.
  • Labels are short and specific: “Work email”, not “Please enter your email address”.
  • Put format rules in the hint, before the user types: “At least 8 characters”, “e.g. 2026-11-30”.
  • Mark what’s required consistently. eds-form marks required fields; don’t add your own asterisks or “(optional)” in labels as well.
  • Choose the right control: 2–5 options are radios, more are a select, a yes/no is a checkbox or switch.

Handle errors

  • eds-form checks fields as the user types and blocks the submit until they pass. Don’t add a second layer of checks in the page.
  • Say how to fix it, next to the field: “Enter an email address like name@example.org”, not “Invalid”.
  • On a failed submit, the summary above the form says how many fields need attention. Set its text with error-message.
  • Keep what the user typed. Never clear the form after an error.
  • Server errors that aren’t about one field go in an alert above the form.

Buttons and submitting

  • One primary button, named for what happens: “Send request”, “Create project”. Not “Submit”.
  • A Clear button (clear-btn) only on long forms people fill in repeatedly; it is easy to press by accident.
  • While sending, set submitting so the button shows progress and can’t be pressed twice.
  • After success, say what happens next: “Request sent. We’ll email you within two working days.” Show it on the page or in a toast, and don’t leave the filled form behind looking unsent.

Consent and personal data

  • Ask for consent with its own unticked checkbox, with a link to the privacy notice. Never pre-tick it, and never bundle it with the terms.
  • Only claim compliance where it is true: the gdpr badge on brand forms is off by default for that reason.

Do and don’t

DoDon’t
Ask only what you needCollect data “in case”
Use visible labels above fieldsUse placeholders as labels
Explain the format in a hintReveal rules only in the error
Name the button after the actionUse “Submit” or “OK”
Keep input after an errorReset the form
Confirm success and the next stepEnd on a blank page

See also