meid validator

Validate a MEID (mobile equipment identifier)

Options

Using with form field
The HTML attributes are used to set the validator options via the Declarative plugin
NameHTML attributeTypeDescription
messagedata-fv-meid___messageStringThe error message
Using with ES6 module
// You might need to change the importing path
import meid from 'formvalidation/dist/es6/validators/meid';
const result = meid().validate({
value: ...,
options: {
message: ...,
},
});
/*
result is an object of
{
valid: true or false,
message: The error message
}
*/

Basic example

meid validator

ES6 Module Example

The following snippet shows how to use the meid validator with ES6 module:
// You might need to change the importing path
import meid from 'formvalidation/dist/es6/validators/meid';
const res1 = meid().validate({
value: 'A00000049259B16',
options: {
message: 'The value is not valid MEID',
},
});
// res1.valid === true
const res2 = meid().validate({
value: '2936087365007037101',
options: {
message: 'The value is not valid MEID',
},
});
// res2.valid === false

See also

Changelog

v1.4.0
  • Fix an issue that the meid validator passes an invalid MEID which ends with 0