Skip to main content

Value dependencies

Using lookup select boxes you can set up complex dependencies between values. The target field will be filtered when the page loads and on all changes to the filter field(s).

Single dependency

lookupValueFilterOnChange(fieldNameTarget, fieldNameSource, tripleArrayOfConditions);
var conditions = [
  [ TargetValue, SourceValue ... ],
];
var conditions = [
  ["Ding", "Foo"],
  ["Dong", "Foo"],
  ["Ding", "Bar"],
];
lookupValueFilterOnChange("LOOKUP", "FILTER", conditions);

In the above "Ding" and "Dong" will be available to select when FILTER = "Foo"

Double dependency

lookupValueFilterDoubleOnChange(fieldNameTarget, fieldNameSource1, fieldNameSource2, tripleArrayOfConditions);
var conditions = [
  ["Ding", "Foo", "Cat"],
  ["Dong", "Foo", "Dog"],
  ["Ding", "Bar", "Cat"],
  ["Dong", "Bar", "Fish"],
];
lookupValueFilterDoubleOnChange("LOOKUP", "FILTERA", "FILTERB", conditions);

In the above "Ding" will be available to select when eitherĀ :

  • FILTERA = "Foo" -AND- FilterB = "Cat"
  • FILTERA = "Bar" -AND- FilterB = "Cat"