Validators / vin

Validate an US VIN (Vehicle Identification Number).

Options

Option HTML attribute Type Description
message data-bv-vin-message String The error message

Example

Sample VIN for testing

randomvin.com helps you generate a random vin.

VIN Result
1FAHP26W49G252740
2FTRX07W53C371582
WP0CA29863U153381
JTMKF4DV5B5309254
<form id="vinForm" class="form-horizontal">
    <div class="form-group">
        <label class="col-lg-3 control-label">VIN</label>
        <div class="col-lg-5">
            <input type="text" class="form-control" name="vin" />
        </div>
    </div>
</form>
$(document).ready(function() {
    $('#vinForm').bootstrapValidator({
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            vin: {
                validators: {
                    vin: {
                        message: 'The VIN number is not valid'
                    }
                }
            }
        }
    });
});