Manual Form Builder

Form modes — create, edit, show

A table normally has three forms — one per mode.

Why three?

The same set of fields shouldn't always behave the same way:

  • On Create, the user fills in everything.
  • On Edit, some fields should become read-only (you don't want them changing the IC number after the fact).
  • On Show, nothing is editable — it's a print-style read view.

Builder lets you build each mode as a separate form so you can tweak each independently. The default forms Luna generates already cover the common case.

Keep them in sync

The danger of separate forms is drift — a new field on the table gets added to Create but not to Edit. Two months later someone notices an edit form missing a field and wonders why.

Helpful habits:

  • Whenever you add a field to the table, decide on all three modes before publishing. The Show form is easy to forget.
  • Use the Compare across modes affordance (top-right of the form builder) to see which fields are missing where.
  • Common rule of thumb: Create and Edit show the same fields, but Edit marks more of them read-only. Show shows everything, read-only.

Custom named forms

You can also build extra forms for the same table. Examples:

  • A Quick Submit form for staff with only the bare minimum fields.
  • An HR Bulk Entry form with extra admin-only fields and no validation.

Each named form has a unique code, picks a mode, and lives alongside the defaults. Use the From Form action on the menu builder to link a menu item to a specific named form.

Where to next

  • Validation messages — clear errors when the user types something wrong.
  • Common mistakes.