Address forms should rearrange dynamically by country
Aliases: dynamic address form · address field reordering · adaptive address form
What it is
A country-adaptive address form changes field order, labels, requiredness, choices, and validation contract after the destination country or territory is known. Dynamic rearrangement does not mean destroying and recreating the form on every country change. The system must preserve input that still has meaning, keep focus and reading order predictable, and expose the change to assistive technology. The collection schema changes; the person's in-progress address must not silently disappear.
Why it happens
Country templates determine which address components occur and how they are ordered, so a fixed form makes people jump through an unfamiliar structure. A dynamic form also creates a state-transition problem: old-schema values must map to the new schema, metadata may load asynchronously, hidden fields must stop enforcing old rules, and autofill needs stable semantic tokens. If a framework keys fields by array position, reordering can swap values or lose focus. If visual and DOM order differ, keyboard and screen-reader users encounter a different form. A robust implementation stores state under semantic field IDs, drives rendering and submission validation from the same schema, and asks users to resolve data that cannot be mapped safely.
Studying it
Build a transition matrix between representative country schemas and exercise it with blank, partially completed, invalid, autofilled, and slow-network states. Have participants enter part of an address and then change country; measure retained data, error recovery, lost focus, repeated input, and successful submission. Keyboard and screen-reader sessions should inspect reading order, label association, error summaries, and change announcements. Automated tests should compare the visible client schema, submission payload, and server validation version while injecting failed metadata loads, rapid switching, and restoration of an older draft.
Where it stops holding
Country usually belongs before dependent address fields, but autocomplete, account data, or imported records may infer it first; show that inference and let people verify it. Cross-border, military, and exceptional-territory addresses may not fit the ordinary template, requiring free-form or manual-review paths. When a person intentionally switches to an incompatible schema, some values cannot be migrated automatically. Keeping them invisibly risks a wrong submission, while immediate deletion loses data, so explain the conflict and request a choice. A client schema never replaces server validation against the same versioned contract.
Applying it
- Select the destination country or territory first, then load a versioned schema. Store values under stable semantic keys, and use that same schema for order, labels, requiredness, options, and client/server validation.
- On country change, map semantically identical fields and retain free-form lines as a draft requiring confirmation, not as a newly valid address ready to submit. Summarize non-empty values that would become hidden or cannot map and let the person edit, migrate, or remove them.
- Keep focus on the country control by default and announce changes through a live/status message. Move focus to a conflict summary or first unresolved field only after explicit continuation or when a conflict must be handled. Align DOM, visual, and keyboard order.
- Use standard autocomplete semantics such as
country,postal-code, andaddress-level1, without treating tokens as local requiredness rules. Test partial-input switching, browser autofill, back-navigation restore, slow and offline states, screen readers, and mismatched server schema versions.
Related
- Same group: S2.06.1 Address hierarchy depth and order vary by country · S2.06.2 Postal codes are not universal in presence, length, or format · S2.06.3 A state or province field is not universally applicable
- Adjacent: S4.01.4 Preserve page and state after switching · S2.09.4 Be permissive at input and strict at output
- Search terms:
adaptive address form·address schema·autocomplete address-level1