3

I am looking for a module or a method in Drupal 7 that can achieve the following:

I have a field in a content type called e.g. "Is the Ladder Attached". It has a select list, YES or NO.

When a user selects YES then I want it to populate another field next to it saying "No Hazard".

When a user selects NO then I want it to populate another field next to it saying "Hazard".

How can this be done? I tried the conditional field module and it doesn't seem to be the right solution.

Thanks

1
3

You can try the Field Conditional State module: With field conditional state module you can set #state form field attribute based on value selected in other form fields.

Module splits fields into two types:

  • Control field - field which set #state attribute based on the value from that field
  • controled field - field for which #state attribute is set based on the value from the control field.

Module supports AND/OR functionality for control fields which means:

  • AND - all choices must be selected to control the filed (example: field A will be visible when in field B option 1 and option 2 is selected)
  • OR - any choice will control field (example: field A will be visible when in field B option 1 or option 2 is selected).
1

I think Conditional Fields best suits your requirement.

Conditional Fields allows you to manage sets of dependencies between fields. When a field is “dependent”, it will only be available for editing and displayed if the state of the “dependee” field matches the right condition. When editing a node (or any other entity type that supports fields, like users and categories), the dependent fields are dynamically modified with the States API.

Follow this https://drupal.org/project/conditional_fields

1
  • or simply you can write some js to show hide a div what conditional fields module does.... Sep 8 '14 at 4:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.