method
TextListField.Validate
Add a rule for the whole list when saving.
Arguments
| Argument | Type | Description |
|---|---|---|
value | Validator[[]string] | A callback receiving operation.ValidationContext and operation.Value[[]string], returning ([]operation.Issue, error). |
Returns
The updated TextListField; the original field is unchanged.
TextListFieldHow 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
func (f TextListField) Validate(value Validator[[]string]) TextListFieldRelated types
TextListFieldA configurable list of strings.
ValidatorValidator 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.