Skip to content

Field rendered as read-only but still enforced as required, preventing save #8144

@grantfitzsimmons

Description

@grantfitzsimmons

Describe the bug
When the field is added to a form using the following XML:

<row>
  <cell type="label" labelfor="id"/>
  <cell type="field" id="id" uitype="text" name="id" colspan="5"/>
</row>

…the field is rendered as read-only in the UI. However, if that field is marked as required in the schema configuration, the form cannot be saved even though the user cannot provide input for a read-only field.

To Reproduce

  1. Configure a form with the XML above to include the "id" field.
  2. Ensure that the schema config marks "id" as required.
  3. Attempt to submit the form.

Expected behavior
If the field is rendered as read-only (non-editable), the "required" requirement should not prevent form submission. Required validation should not apply to fields that are not user-editable.

Actual behavior
The form cannot be saved, reporting a missing value for the required "id" field, even though it is read-only.

Additional context
The issue appears to be a mismatch between form rendering (read-only) and schema validation (required), resulting in unfulfillable validation rules.

Reported By
CSIRO in BoldDesk ticket #975

Metadata

Metadata

Assignees

No one assigned

    Labels

    2 - FormsIssues that are related to the form system2 - Schema ConfigIssues that are related to the Schema Config tool

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions