This site contains the document for old version. Please upgrade to the latest version v1.0.0

imei validator

Validate an IMEI (International Mobile Station Equipment Identity)

Validators

Options

Option HTML attribute Type Description
message data-fv-imei-message String The error message
When setting options via HTML attributes, remember to enable the validator by setting data-fv-imei="true".
The message option can be updated on the fly via the updateMessage() method

Example

<form id="imeiForm" class="form-horizontal">
    <div class="form-group">
        <label class="col-xs-3 control-label">IMEI</label>
        <div class="col-xs-5">
            <input type="text" class="form-control" name="imei" />
        </div>
    </div>
</form>

<script>
$(document).ready(function() {
    $('#imeiForm').formValidation({
        framework: 'bootstrap',
        icon: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            imei: {
                validators: {
                    imei: {
                        message: 'The value is not valid IMEI'
                    }
                }
            }
        }
    });
});
</script>
<form id="imeiForm" class="form-horizontal"
    data-fv-framework="bootstrap"
    data-fv-icon-valid="glyphicon glyphicon-ok"
    data-fv-icon-invalid="glyphicon glyphicon-remove"
    data-fv-icon-validating="glyphicon glyphicon-refresh">

    <div class="form-group">
        <label class="col-xs-3 control-label">IMEI</label>
        <div class="col-xs-5">
            <input type="text" class="form-control" name="imei"
                data-fv-imei="true"
                data-fv-imei-message="The value is not valid IMEI" />
        </div>
    </div>
</form>

<script>
$(document).ready(function() {
    $('#imeiForm').formValidation();
});
</script>

Related validators

The following validators might be useful to you: