programer.tips, another cool thing from @nghuuphuoc!

imei validator

Validate an IMEI (International Mobile Station Equipment Identity)

Validators

Improve it on Github

Options

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

Example

IMEI Result
35-209900-176148-1
35-209900-176148-23
3568680000414120
490154203237518
490154203237517
<form id="imeiForm" class="form-horizontal">
    <div class="form-group">
        <label class="col-sm-3 control-label">IMEI</label>
        <div class="col-sm-5">
            <input type="text" class="form-control" name="imei" />
        </div>
    </div>
</form>
$(document).ready(function() {
    $('#imeiForm').bootstrapValidator({
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            imei: {
                validators: {
                    imei: {
                        message: 'The value is not valid IMEI'
                    }
                }
            }
        }
    });
});

Related validators

The following validators might be useful to you: