v0.5.3 is released on 2014.11.05!

ean validator

Validate an EAN (International Article Number)

Validators

Improve it on Github

Options

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

Example

EAN Result
73513537
9780471117094
4006381333931
73513536
<form id="eanForm" class="form-horizontal">
    <div class="form-group">
        <label class="col-sm-3 control-label">EAN</label>
        <div class="col-sm-5">
            <input type="text" class="form-control" name="ean" />
        </div>
    </div>
</form>
$(document).ready(function() {
    $('#eanForm').bootstrapValidator({
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            ean: {
                validators: {
                    ean: {
                        message: 'The value is not valid EAN'
                    }
                }
            }
        }
    });
});

Related validators

The following validators might be useful to you: