Skip to content
Ed Mozley edited this page May 13, 2026 · 1 revision

Forms

Folder: forms/ Colour: Teal #00897b

Dynamic form builder and submission system with a unified sidebar + editor layout, AI-assisted form generation, A4-style fillable rendering, and CSV-exportable submissions.

Form List & Builder (index.php)

Unified sidebar + editor layout:

  • Sidebar shows a searchable list of all forms with quick actions per form (Fill In, Submissions, Delete)
  • Main area has full-width title/description inputs and a tabbed editor:
    • Fields tab — drag-and-drop field reordering, type-aware editors
    • Preview tab — live preview of the filler-style rendering

Click a form in the sidebar to edit it inline. Unsaved-changes indicator + browser leave warning. Toast notifications on save and delete.

AI Assist

Toolbar button opens a modal where the analyst describes the form in plain English. A streaming Claude call (claude.ai-style live token output via SSE) generates a complete form definition:

  • Title
  • Description
  • Field types
  • Labels
  • Required flags
  • Dropdown options

…and applies it to the builder. Three example prompts on the modal for quick starts.

Reuses the Anthropic API key configured for the RFP Builder under Contracts → Settings → RFP AI.

Filler (fill.php)

A4-style form rendering with company logo (alignment configurable in settings — left / centre / right). Required field validation. Submissions are saved to the database and immediately visible on the Submissions page.

Submissions (submissions.php)

  • Table view of all submissions
  • Click any row for a detail modal with all field values
  • Date range filtering
  • CSV export with UTF-8 BOM so Excel handles non-ASCII correctly

Settings

Gear icon in the sidebar opens a settings modal:

  • Logo alignment (left / centre / right) — applied to both Preview and Fill-In views

Field Types

Type Notes
text Single-line input
textarea Multi-line input
checkbox Boolean
dropdown Single select with configurable options

Help

Full-page guide at forms/help.php with left-pane navigation, scroll-spy, and 7 sections covering the form builder, field types, filling in forms, submissions, CSV export, settings, quick tips.

Key Tables

Table Purpose
forms Form definitions
form_fields Per-form field definitions (type, label, options, required, display order)
form_submissions One row per submission
form_submission_values Per-field values per submission

Clone this wiki locally