validators
constvalidators:object
Defined in: form/validation.ts:200
Common validator presets Experimental. The form validators may move to a separate forms package, or go, in the review before 1.0.
Type Declaration
Section titled “Type Declaration”date: (
message) => (value) =>string|true
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
message? | string |
Returns
Section titled “Returns”(value) => string | true
email: (
message) => (value) =>string|true
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
message? | string | 'Please enter a valid email address' |
Returns
Section titled “Returns”(value) => string | true
maxLength
Section titled “maxLength”maxLength: (
max,message?) => (value) =>string|true
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
max | number |
message? | string |
Returns
Section titled “Returns”(value) => string | true
minLength
Section titled “minLength”minLength: (
min,message?) => (value) =>string|true
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
min | number |
message? | string |
Returns
Section titled “Returns”(value) => string | true
numeric
Section titled “numeric”numeric: (
message) => (value) =>string|true
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
message? | string | 'Must be a number' |
Returns
Section titled “Returns”(value) => string | true
phone: (
message) => (value) =>string|true
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
message? | string | 'Please enter a valid phone number' |
Returns
Section titled “Returns”(value) => string | true
required
Section titled “required”required: (
message) => (value) =>string|true
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
message? | string | 'This field is required' |
Returns
Section titled “Returns”(value) => string | true
url: (
message) => (value) =>string|true
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
message? | string | 'Please enter a valid URL' |
Returns
Section titled “Returns”(value) => string | true