Validate an EAN (International Article Number).
Option | HTML attribute | Type | Description |
---|---|---|---|
message |
data-bv-ean-message |
String | The error message |
EAN | Result |
---|---|
73513537 | |
9780471117094 | |
4006381333931 | |
73513536 |
<form id="eanForm" class="form-horizontal">
<div class="form-group">
<label class="col-lg-3 control-label">EAN</label>
<div class="col-lg-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'
}
}
}
}
});
});
The following validators might be useful to you: