grid validator
Validate a GRId (Global Release Identifier)
Options
Using with form field
Name | HTML attribute | Type | Description |
---|
message | data-fv-grid___message | String | The error message |
Using with ES6 module
import grid from 'formvalidation/dist/es6/validators/grid';
const result = grid().validate({
value: ...,
options: {
message: ...,
},
});
Basic example
ES6 Module Example
The following snippet shows how to use the grid validator with ES6 module:
import grid from 'formvalidation/dist/es6/validators/grid';
const res1 = grid().validate({
value: 'A12425GABC1234002M',
options: {
message: 'The value is not valid GRId',
},
});
const res2 = grid().validate({
value: 'A1-2425G-ABC1234002-Q',
options: {
message: 'The value is not valid GRId',
},
});
See also