ADR 0382: The quote form is one plain accessible form, in a fence and a landing section, that renders nothing until quote requests are on
- Status: Accepted
- Date: 2026-10-29
- Parent story: #485
- Task: #515
- Parent epic: #474
- Builds on: ADR 0381, ADR 0306, ADR 0291, ADR 0314
Context#
The form must be placeable on any page, work without JavaScript, and change nothing for a site that never turns it on.
Decision#
- One form, written once in core (
openblog_core::quote::form_html), used by both placements: aquotefence in a post, and aquote-formlanding section (landing version 2, like business facts, ADR 0306). The Landing builder lists it as "Quote request form". - Settings. A versioned-free
quotemember ofopenblog.json:enabled(default false),endpoint(a path such as/api/quote, the default, or anhttps://address; no queries, spaces or markup), and one line ofnotice. Absent or default is omitted from the written file. - Off renders nothing new. With
enabledfalse the section produces no markup, no capability and no script, and aquotefence is not read as a form at all: it stays the ordinary code block it was before this feature existed, so an older post with a code block labelledquotebuilds and shows as it did. The output is byte for byte what it was. Withenabledtrue a portable copy (feeds, export, syndication) never carries the form: the portable HTML, Markdown and text all drop the fence, and it is not a semantic fact the copy must keep. - Choices from the site. Towns come from
serviceAreas(ADR 0314) in the order stated; services come from the services collection in the landing section, and fromservice:lines in the fence (the fence is rendered before the collection is known). With no list a field is a text box. Everything is escaped. - Plain HTML first. A
<form method="post" enctype="multipart/form-data">to<endpoint>/submit; every field has a visible<label>, hint and error element tied byaria-describedby; phone, email, name and town carryautocomplete; the honeypot is a labelled field moved off screen and hidden from assistive technology; the status line isrole="status". The markup holds no request value, so no personal field can reach static output. - Enhancement.
<ob-quote>(web/components/ob-quote.jsand the pureob-quote-model.js) fetches the form token, checks fields with the same rules as the server, says each problem beside its field and moves focus to the first, shrinks photos with a canvas to the server's 900 KB bound, shows upload progress, and replaces the form with a confirmation. It sends only to its ownendpoint, stores nothing in the browser, and steps aside (the browser posts the form) when no token can be fetched. - Ids stay unique with a per-placement prefix, so a page may hold several forms.
Consequences#
The landing builder adds a section type (SECTION_TYPES is 16). Admin cannot yet show whether the hosted
function is reachable; the setup guide says how to check. The accessibility contract is tested as markup (labels,
descriptions, live region), in a real browser at 400 px, and with axe-core (a pinned dev dependency of
tests/browser) for WCAG 2.1 A and AA in light and dark.