This function will hide one or more fields on the current page when a given condition is met.
Unlike .showField and .hideField, which can be used to show or hide one field at a time as part of a function you have written, this function takes an array of field names and will hide them all if a condition is met. If the condition is not met, the fields will be shown.
It is also able to clear any values entered into the fields as part of the show/hide.
.showFieldWhen performs the opposite.
Arguments
| Argument | Type | Description |
|---|---|---|
| fieldNames | Array, required | The names of the fields to be hidden |
| condition | Expression, required | The expression should return true or false, and will determine whether the fields are hidden (true) or shown (false) |
| emptyField | Boolean, required | If true the values of the named fields will also be cleared when they are hidden |
Returns
None.
Example
In this example, all of the named fields will be hidden when the value of the current field (a radio button group) is "hide". The values will also be cleared.

function(helper, fieldName, value, valid, eventName) {
let fields = ['FIELD20', 'FIELD22', 'FIELD30', 'FIELD23'];
helper.hideFieldWhen(fields, value == 'hide', true);
}
