Form Functional Logic
The following outlines the required behaviors and validation rules for the Hydraulic Through-Floor Lift Inspection Report to ensure data integrity and user efficiency.
1. Progressive Disclosure (Section Visibility)
To reduce visual clutter, the form utilizes a parent/child relationship for major inspection categories (Sections 1–5).
- Default State: Inspection categories should default to a collapsed state.
- "Complete" Selection: If the user selects "Complete" at the section level, the system implies that all underlying checks are Satisfactory. Any previously entered data in the sub-points of that section should be cleared/reset to null.
- "Action Required" Selection: This triggers the expansion of the section, revealing the specific line items (sub-points) for individual assessment.
2. Conditional Validation (Sub-Point Level)
Each individual inspection point (e.g., "RCD Device") has three possible statuses: Satisfactory (S), Action Required (A), or Not Applicable (N/A).
- Mandatory Comments: The "Action Required Detail" text input must only be visible if the status is set to Action Required (A). In this state, the text field must become mandatory to prevent submission without details.
- Reset on Change: If a user changes a status from "Action Required" back to "Satisfactory" or "N/A", the text input should hide and its value should be cleared.
3. Automated Date Calculation & Validation
The date fields require specific logic to ensure accuracy and prevent impossible entries:
- Date Restriction (Service Date): The "Date of Service" input must be restricted to prevent future dates. The system must dynamically set the
maxattribute to the current date (today). - Next Service Auto-Fill: [Date of Service] + [Frequency Duration] = [Next Service Due]. Logic should execute immediately when either the service date or frequency selection changes.
4. Auto-Fill Features
- Signature Mirroring: To streamline workflow, the "Engineer Signature" field should automatically reflect the value entered in "Engineer Name" in real-time. This should only occur if the signature field has not been manually edited/overridden by the user.
5. Section-Specific Variations
- Smoke Alarm Interlock (Section 1): This safety check follows standard sub-point logic but explicitly requires the "N/A" option to remain available. This ensures engineers can validate older lifts where this interlock was not a requirement at the time of installation.
- Trapdoor Section (Section 3): Requires a third top-level option: "Not Applicable (N/A)". Selecting this functions similarly to "Complete" (collapsing the section and clearing data) but records a distinct status of "N/A" for the section.
- Standalone Questions (Section 6): Items such as "Controls" and "Pads/Guides" are critical single-point checks. These do not have a parent "Section Toggle" and are always visible, but they must adhere to the same Conditional Validation logic (S/A/NA) described in item #2.