method
NumberListField.Validate
Add a rule for the whole list when saving.
Arguments
| Argument | Type | Description |
|---|---|---|
value | Validator[[]float64] | A callback receiving operation.ValidationContext and operation.Value[[]float64], returning ([]operation.Issue, error). |
Returns
The updated NumberListField; the original field is unchanged.
NumberListFieldHow 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 NumberListField) Validate(value Validator[[]float64]) NumberListFieldRelated types
NumberListFieldA configurable list of numbers.
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.