FormBuilderDSL.Validations (form_builder_dsl v0.1.2)
View SourceProvides validation helpers for form fields.
This module contains functions for validating form field values based on the validation rules defined in the form.
Summary
Functions
Validates a field value against its validation rules.
Functions
Validates a field value against its validation rules.
Parameters
value
- The value to validatevalidations
- List of validation rules
Returns
:ok
if validation passes{:error, reason}
if validation fails
Validation Rules
:required
- Value must be present:min_length
- String must be at least this long:max_length
- String must be at most this long:min
- Number must be at least this value:max
- Number must be at most this value:format
- Value must match the given format:in
- Value must be in the given list