Skip to content

Field with depends_on condition non satisfied (hidden), required, triggers validation error (collective.easyform 3.2.1, Plone 5.2.14) #461

@fabiSwDevBeg

Description

@fabiSwDevBeg

Problem

When a field has a depends_on condition that is not satisfied (so the field is hidden), and the field is marked as required, the form still raises a validation error for that hidden field.

This makes it impossible to submit the form, even though the field is not visible to the user.

Steps to reproduce

  1. Create an EasyForm.
  2. Add a field fieldA (e.g., a checkbox or select) that controls visibility of another field.
  3. Add a required field fieldB, and configure its depends_on condition to only show when fieldA is true.
  4. Leave fieldA unchecked (so fieldB stays hidden).
  5. Submit the form.

Expected behavior:
Form should submit successfully, since the hidden field fieldB is not shown to the user.

Actual behavior:
Form raises a validation error:

Environment

  • Plone 5.2.14
  • collective.easyform 3.2.1
  • Python 3.8.18

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions