Skip to content

Validating a boolean (checkbox) that is required to be true #736

Closed
@TimCorey

Description

@TimCorey

I've included a boolean field in my schema form demo. I would like it to be a "Terms and Conditions" checkbox, where the user is required to check the box before continuing. Making the field a required field does nothing, I assume because false is a value. In order to gain the functionality to require the checkbox to be checked, I added a function to the $validators object. This worked in that the form cannot be processed without the checkbox being checked. However, the user is given no message below the checkbox itself, even though I included a validation message.

Have I missed something? I'd love for the checkbox to get the same validation cues as input fields.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions