I can alter the value of a dropdown via jQuery. This dropdown acts as a controlling field. How can i change the visibility of the controlled fields, when its value is changed by jQuery?
I can alter the value of a dropdown via jQuery. This dropdown acts as a controlling field. How can i change the visibility of the controlled fields, when its value is changed by jQuery?
Comments
Comment #1
peterpoe commentedBetter late than never:
There are three functions involved in conditional_fields.js:
Drupal.ConditionalFields.fieldChange is fired when a form event occurs (change or keydown). It gathers the field values using Drupal.ConditionalFields.findValues, finds the wrapper's id and passes them to Drupal.ConditionalFields.switchField. Depending on what you want to achieve, you might want to bind fieldChange to an event, or call manually switchField with the right parameters on your custom event.