Apply conditional logic on checkbox in multi checkbox element.

Created on 22 May 2023, over 1 year ago
Updated 2 April 2024, 9 months ago

Problem/Motivation

At the moment conditional logic applies on multi checkboxes element as a whole and if we want to apply it to only a checkbox in multi checkboxes element then is not possible.

Proposed resolution

There can be a additional dropdown before sates dropdown containing list of all checkboxes from the checkboxes element and it let editor configure conditional logic for each checkbox in element.

Is this feature desirable? Can a maintainer give his feedback on it and also if he can give some guidelines on how to proceed with it.

✨ Feature request
Status

Closed: won't fix

Version

6.2

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany majid.ali

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

Comments & Activities

  • Issue created by @majid.ali
  • Webform 8.x-5.x (for Drupal 8) is no longer supported.

  • Status changed to Closed: won't fix over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    Below is an example of attempting to get a condition working when any checkbox is selected. It does not work as expected. This feature is not supported and should be handled using custom code.

    checkboxes:
      '#type': checkboxes
      '#title': checkboxes
      '#options':
        one: one
        two: two
        three: three
    one:
      '#type': markup
      '#states':
        visible:
          ':input[name="checkboxes[one]"]':
            checked: true
      '#markup': '<p>One</p>'
    two:
      '#type': markup
      '#states':
        visible:
          ':input[name="checkboxes[two]"]':
            checked: true
      '#markup': '<p>Two</p>'
    three:
      '#type': markup
      '#states':
        visible:
          ':input[name="checkboxes[three]"]':
            checked: true
      '#markup': '<p>three</p>'
    any:
      '#type': markup
      '#states':
        visible:
          ':input[name^="checkboxes"]':
            checked: true
      '#markup': '<p>Any</p>'
    
  • πŸ‡΅πŸ‡±Poland IProSoft

    Hi,
    I've also found this problem in webform conditional.
    Is this still not supported ?

Production build 0.71.5 2024