method

TextListField.Validate

Add a rule for the whole list when saving.

Arguments

ArgumentTypeDescription
valueValidator[[]string]A callback receiving operation.ValidationContext and operation.Value[[]string], returning ([]operation.Issue, error).

Returns

The updated TextListField; the original field is unchanged.

TextListField

How it works

The callback runs once for the whole list. It appends to existing save validators.

Return issues on the list field; items have no individual issue targets. Return nil, nil to accept the value, or an error when the check cannot complete.

For feedback while editing, register a separate LiveValidate callback too.

Full signature

Related types

  • TextListField

    A configurable list of strings.

  • Validator

    Validator checks a field before saving, after built-in checks and write hooks. Return issues for values the author needs to fix, or an error if the check could not run. An issue belongs to this field unless its Target names a child.

Related guides