Multiple conditions for an element

Created on 15 February 2024, 8 months ago
Updated 16 February 2024, 8 months ago

Problem/Motivation

Same motivation as in issue: 3193972

Sorry for my lack of understanding....

I have visited https://www.lullabot.com/articles/form-api-states and your answer in the mentioned issue, but I do not get how to implement multiple conditions...

I have:

visible:
  ':input[name="audio_1_choice"]':
    checked: true #first condition
    value: High #second condition

I have tried some variations on the code, even with pattern as you suggest, but none has worked for me. I will appreciate your help!

💬 Support request
Status

Closed: works as designed

Version

6.2

Component

Code

Created by

🇨🇱Chile Andrés Chandía

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

Comments & Activities

  • Issue created by @Andrés Chandía
  • Status changed to Closed: works as designed 8 months ago
  • 🇨🇱Chile Andrés Chandía

    Thanks, I have finally solved this way:

     feedback_right_01:
        '#type': message
        '#states':
          visible-slide:
            ':input[name="options_audio_01"]':
              value: High
        '#message_message': 'Right answer'
        '#message_close': true
      feedback_wrong_01:
        '#type': message
        '#states':
          visible-slide:
            ':input[name="options_audio_01"]':
              value:
                pattern: ^(Low|Rising|Falling)$   ########  HERE'S THE PATTERN ######
        '#message_type': error
        '#message_message': 'Sorry, this is not the right answer!'
        '#message_close': true
    
Production build 0.71.5 2024