make field dependent on a multiple choice

Hello,

Having a bit of an issue with making a field dependent on a multiple choice field.

Take for example 2 fields

v_type (either single choice or multiple choice with values based on a dropdown list)

v_detail -> this field should be dependent on v_type like so isInList($v_type ,createList("02"))

However this only works if the v_type is a single choice field , if it's a multiple choice it will not even appear in the list of fields.

I also can't select the multiple select choice as the parent dropdown either.

Is there any way to get around this?

Edit:

Found this :  Field dependancy : display a textfield dependant from a custom multi-enum   Will try and report back with more info ~

Parents Reply Children
  • Hello o/

    Indeed thanks , linked to it only problem I had was with the underscore's indexOf and checking for multiple conditions which I changed by extending the array prototype with a contains method

    Array.prototype.contains = function ( needle ) { for (i in this) { if (this[i] == needle) return true; } return false; };

    and checking for multiple conditions like

    if (this.model.get('objectifs_c').contains("1") ||this.model.get('objectifs_c').contains("2")  {
     $('[data-name="v_list_brochure"]').removeClass("vis_action_hidden").fadeIn().removeAttr("style");
     }
    

    I'm using the keys instead of the name of the multi select options because those names can change over time.