Score:0

How to change the display order of webform elements (conditional logic)?

aq flag

How to change order (weight) of webform elements in conditional logic based on the visibility of other elements?

My webform example, six fields:

  1. Open field A? (Checkbox yes/no)

  2. Field A is hidden (textfield, hidden because current-page-node-field-a is null)

  3. Open field B? (Checkbox yes/no)

  4. Field B is hidden (textfield, hidden because current-page-node-field-b is null)

  5. Open field C? (Checkbox yes/no)

  6. Field C is open (textfield, opened because current-page-node-field-c NOT null)

Now, what I want...

I would like to add conditional rule to field C, so that if it is open, show it sэhigher than field A and field B (i.e. change the weight of the fields).

How to achieve this?

ru flag
You can't change weight with [conditional state logic](https://www.drupal.org/docs/drupal-apis/form-api/conditional-form-fields#s-the-form-api-states-property), you have to write a form alter hook.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.