Show or hide a Custom Field based on the selected value of another Field.
/** * OUM: Conditional Field * * sourceField Element that defines the condition * targetField Element to show or hide * condShow Array of values that lead to show * condHide Array of values that lead to hide */ oumConditionalField(sourceField, targetField, condShow, condHide);
Here is an example:
oumConditionalField('[name="oum_marker_icon"]', '[name="oum_location_custom_fields"]', ['30', '31'], ['']);
The custom field with the attribute name=”oum_location_custom_fields” will only show up if the value of the field with the attribute name=”oum_marker_icon” has value 30 or 31. Otherwise it will be hidden.