Im trying to show few fields depending on one field's value. below is my scenario:

- I created a field using List(text) field type and select list as widget
- the value of this field is Yes and No
- I created another text field which will be showing when the above field value is Yes
- the state setting of the text field as following
- Control field: Exactly one condition must be true (XOR)
- Trigger state: Value is
- Trigger value: Yes

When I go to the edit page of fields, the text field is shown instead of hidden. But the required state is working fine.

Did I do anything wrong?

CommentFileSizeAuthor
#3 select_list_issue.png43.08 KBaseabrook

Comments

jj0914’s picture

I also noticed that I only have following trigger value:

-Empty
-Filled
-Value is

Im missing checked/unchecked

Tobias Xy’s picture

Status: Active » Postponed (maintainer needs more info)

Here it works as expected. In which tab did you create the state? (It should be "visible")
Do you have access to the database? It might help to see the contents of the field_conditional_states and field_conditional_state_groups tables.

Checked and unchecked are missing on purpose: They are only applicable to checkboxes, because normally you can't say which value of a list field should be the "checked" value and which the "unchecked" value.

aseabrook’s picture

StatusFileSize
new43.08 KB

There's an issue with select lists. When the node creation form loads, the target field is visible even though its 'Visible' conditional state is configured to be visible only when a specific option in the select list is chosen. For example, you have two fields:

  1. Type of post
  2. Image

There are 3 options in "Type of post":

  1. Blog
  2. Recipe
  3. Coffee

The 'Blog' option is set as the default in the field settings.

The Image field's 'Visible' conditional state is configured so that when the "Type of post" field options 'Recipe' or 'Coffee' are chosen the Image field will be visible. So, since 'Blog' is set as the default option, the expected behavior when the node creation form is loaded is that the Image field should be hidden until either 'Recipe' or 'Coffee' is chosen...but it isn't. Added screenshot for maximum effect ;)