Dynamically making a select field required/not-required is not working

Created on 2 March 2022, almost 3 years ago
Updated 15 February 2023, almost 2 years ago

Problem/Motivation

When using the module to make a select field (that is optional by default) "required", it adds the required attribute, but the validation part seems to be broken/not working. This is specific to List (Text) fields. I have yet to test out other list-types.

Steps to reproduce

1. Create a new field (List (text)) on a content type/node. (Do not make it required)
2. Apply a new field state to that field (field A) which makes it "required" based on another field's state (field B).
3. Trigger the required state on list/select field (field A), by an action on field B.
4. Without selecting an option in field A, save the node.
5. The "empty" select/list should throw an error, but it does not.

...
6. Do the reverse as it also is not working (set the select/list field to "required" and apply a field state that makes it optional)

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇺🇸United States uri_frazier Portland, Oregon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India nidhi27

    Hello,

    I am also not able to add required in the widget form dynamically. Other attributes are working but required is not working.
    Did you get any solution for this?

Production build 0.71.5 2024