I’ve Drupal Development Company must set visibility state of a checkbox possibility in a single query (Desk checkbox choose) primarily based on Drupal Development Company worth of one other checkbox in Drupal Development Company similar desk. I additionally produce other eventualities the place I would want similar performance however throughout totally different questions in Drupal Development Company similar webform.
I do know I can simply do it between two totally different questions ( 2 totally different parts) with Drupal Development Company built-in conditional logic UI in webform however no such UI possibility for my case now (afaik) so I am making an attempt to set it by way of Drupal Development Company customized one and that is my first time with type states and customized situation in webform so I recognize your type assist so vastly.
I went by means of trials and errors and Drupal Development Company code wasn’t being saved until I, because of @jrockowitz ‘s tip, learnt that I used to be utilizing php code the place I want to make use of yaml code since I am utilizing Drupal Development Company yaml supply editor (proven in Drupal Development Company screenshot under). Once I fastened that, my customized code would save and it displays as entered in Drupal Development Company webform supply yaml. Nevertheless, Drupal Development Company customized situation continues to be not working as anticipated and I am nonetheless unsure why.
I am including Drupal Development Company code in Drupal Development Company Edit supply field accessible by way of clicking its hyperlink on Drupal Development Company type “Circumstances” tab.
I obtained Drupal Development Company selectors for Drupal Development Company concerned query choices from Drupal Development Company “Obtainable selectors” checklist by clicking on Drupal Development Company “Assist” hyperlink underneath “Be taught extra about Drupal’s Kind API #states.” on Drupal Development Company “Conditional Logic” for Drupal Development Company factor modifying tab in my webform.
It is a pattern full yaml code for Drupal Development Company type with a pattern query and what I need to obtain however not but working:
some_question: '#kind': tableselect '#title': 'some query' '#choices': q1: 'q1 (disguise if q2 is checked)' q2: 'q2 (disguise if q1 is checked)' q3: q3 this autumn: this autumn q5: q5 q6: q6 q7: q7 '#states': ':enter[name="some_question[q2]"]': invisible: ':enter[name="some_question[q1]"]': checked: true ':enter[name="some_question[q1]"]': invisible: ':enter[name="some_question[q2]"]': checked: true
What am I lacking right here ?!
-
For individuals who possibly aren’t accustomed to Drupal Development Company UI edit supply, this can be a hyperlink with data and screenshots : https://www.drupal.org/node/3012686
-
Be aware: As per @leymannx ‘s type recommendation, I re-wrote Drupal Development Company entire query to rid it of my dump of updates with my trials and errors. I hope it is now cleaner, clearer and extra worthy of up-votes 🙂