programer.tips, another cool thing from @nghuuphuoc!

meid validator

Validate a MEID (mobile equipment identifier)

Validators

Improve it on Github

Options

Option HTML attribute Type Description
message data-bv-meid-message String The error message
When setting options via HTML attributes, remember to enable the validator by setting data-bv-meid="true".

Example

MEID Result
A00000049259B16
A0-000004-9259B1-6
A0 000004 9259B1 6
2936087365007037100
29360-87365-0070-3710-0
29360 87365 0070 3710 0
AF0123450ABCDE
AF-012345-0ABCDE
AF 012345 0ABCDE
293608736500703710
29360-87365-0070-3710
29360 87365 0070 3710
A00000049259B15
A00000049259B
2936087365007037101
29360873650070371
<form id="meidForm" class="form-horizontal">
    <div class="form-group">
        <label class="col-sm-3 control-label">MEID</label>
        <div class="col-sm-5">
            <input type="text" class="form-control" name="meid" />
        </div>
    </div>
</form>
$(document).ready(function() {
    $('#meidForm').bootstrapValidator({
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            meid: {
                validators: {
                    meid: {
                        message: 'The value is not valid MEID'
                    }
                }
            }
        }
    });
});

Related validators

The following validators might be useful to you: