Options
Option | HTML attribute | Type | Description |
---|---|---|---|
country |
data-fv-iban-country |
String | An ISO-3166 country code. It's dynamic option |
message |
data-fv-iban-message |
String | The error message. The dynamic message is supported |
sepa |
data-fv-iban-sepa |
Boolean | Set it to true (false) to indicate that the IBAN number must be (not be) from SEPA countries. The list of SEPA countries are indicated in the table below. By default, this option is not defined |
When setting options via HTML attributes, remember to
enable the validator by setting data-fv-iban="true".
The message and other options can be updated on the
fly via the updateMessage() and updateOption() methods
If the country
is not defined, it will be parsed from the IBAN number.
The validator supports the following countries (sorted by the country code in alphabetical order):
Example
<form id="ibanForm" class="form-horizontal">
<div class="form-group">
<label class="col-xs-3 control-label">IBAN</label>
<div class="col-xs-7">
<input type="text" class="form-control" name="iban" />
</div>
</div>
</form>
<script>
$(document).ready(function() {
$('#ibanForm').formValidation({
framework: 'bootstrap',
icon: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
iban: {
validators: {
iban: {
message: 'The value is not valid IBAN'
}
}
}
}
});
});
</script>
<form id="ibanForm" 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">IBAN</label>
<div class="col-xs-7">
<input type="text" class="form-control" name="iban"
data-fv-iban="true"
data-fv-iban-message="The value is not valid IBAN" />
</div>
</div>
</form>
<script>
$(document).ready(function() {
$('#ibanForm').formValidation();
});
</script>
Related validators
The following validators might be useful to you: