meid validator

Validate a MEID (mobile equipment identifier)

Options

Use with form field

The HTML attributes are used to set the validator options via the Declarative plugin

Name HTML attribute Type Description
message data-fv-meid___message String The error message

Use with JavaScript module


// You might need to change the importing path
import meid from 'formvalidation/validators/meid';

const result = meid().validate({
    value: ...,
    options: {
        message: ...,
    },
});
/*
result is an object of
{
    valid: true or false,
    message: The error message
}
*/

Basic Example

You can click on sample to see if it's a valid or invalid MEID.

Sample Is valid?
A00000049259B16
A0-000004-9259B1-6
A0 000004 9259B1 6
2936087365007037100
29360-87365-0070-3710-0
29360 87365 0070 3710
AF0123450ABCDE
AF-012345-0ABCDE
AF 012345 0ABCDE
293608736500703710
29360-87365-0070-3710
29360 87365 0070 3710
A00000049259B15
A00000049259B
2936087365007037101
29360873650070371

Module Example

The following snippet shows how to use the meid validator with JavaScript module:


// You might need to change the importing path
import meid from 'formvalidation/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

Related validators

The following validators are similar to this one and might be useful to you.

Name Description
imei Validate an IMEI (International Mobile Station Equipment Identity)