FieldRuleInterface
Fields available on FieldRuleInterface.
| Property | Type | Required |
|---|---|---|
required | boolean | optional |
type | string | optional |
minLength | number | optional |
maxLength | number | optional |
pattern | string | optional |
message | string | optional |
accept | string[] | optional |
maxSizeMB | number | optional |
minFiles | number | optional |
maxFiles | number | optional |
maxWidth | number | optional |
maxHeight | number | optional |
minWidth | number | optional |
minHeight | number | optional |
requiredMessage | string | optional |
typeMessage | string | optional |
sizeMessage | string | optional |
dimensionMessage | string | optional |
Example
NFSFU234FormValidation.configureForms([
{
form: '#profileForm',
fields: {
bio: { required: true, minLength: 10 },
avatar: { accept: ['image'], maxSizeMB: 2, maxWidth: 1000, maxHeight: 1000 }
}
}
]);See also: validateFile, FormConfigInterface.
Last updated on