Conditional fields

Show or hide a Custom Field based on the selected value of another Field.

This is the Javascript function you can use to make this possible:

JavaScript
/**
* 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:

JavaScript
oumConditionalField('[name="oum_marker_icon"]', '[name="oum_location_custom_fields[1645650268221]"]', ['30', '31'], ['']);

The custom field with the attribute name=”oum_location_custom_fields[1645650268221]” 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.

Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support

EN