FormValidation v0.8.1 is released, supports Bootstrap 4 alpha 3

iban validator

Validate an International Bank Account Number (IBAN)

Validators

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):

No. Country Code Sample IBAN Result
1 Albania AL AL47212110090000000235698741
2 Algeria DZ DZ4000400174401001050486
3 Andorra AD AD1200012030200359100100
4 Angola AO AO06000600000100037131174
5 Austria SEPA AT AT611904300234573201
6 Azerbaijan AZ AZ21NABZ00000000137010001944
7 Bahrain BH BH29BMAG1299123456BH00
8 Bosnia and Herzegovina BA BA391290079401028494
9 Belgium SEPA BE BE68539007547034
10 Benin BJ BJ11B00610100400271101192591
11 Brazil BR BR9700360305000010009795493P1
12 Bulgaria SEPA BG BG80BNBG96611020345678
13 Burkina Faso BF BF1030134020015400945000643
14 Burundi BI BI43201011067444
15 Cameroon CM CM2110003001000500000605306
16 Cape Verde CV CV64000300004547069110176
17 Costa Rica CR CR0515202001026284066
18 Croatia SEPA HR HR1210010051863000160
19 Cyprus SEPA CY CY17002001280000001200527600
20 Czech Republic SEPA CZ CZ6508000000192000145399
21 Denmark SEPA DK DK5000400440116243
22 Dominican Republic DO DO28BAGR00000001212453611324
23 East Timor TL TL380080012345678910157
24 Estonia SEPA EE EE382200221020145685
25 Faroe Islands FO FO1464600009692713
26 Finland SEPA FI FI2112345600000785
27 France SEPA FR FR1420041010050500013M02606
28 Guatemala GT GT82TRAJ01020000001210029690
29 Georgia GE GE29NB0000000101904917
30 Germany SEPA DE DE89370400440532013000
31 Gibraltar SEPA GI GI75NWBK000000007099453
32 Greece SEPA GR GR1601101250000000012300695
33 Greenland GL GL8964710001000206
34 Hungary SEPA HU HU42117730161111101800000000
35 Iceland SEPA IS IS140159260076545510730339
36 Iran IR IR580540105180021273113007
37 Ireland SEPA IE IE29AIBK93115212345678
38 Israel IL IL620108000000099999999
39 Italy SEPA IT IT60X0542811101000000123456
40 Ivory Coast CI CI05A00060174100178530011852
41 Jordan JO JO94CBJO0010000000000131000302
42 Kazakhstan KZ KZ176010251000042993
43 Kuwait KW KW74NBOK0000000000001000372151
44 Latvia SEPA LV LV80BANK0000435195001
45 Lebanon LB LB30099900000001001925579115
46 Liechtenstein SEPA LI LI21088100002324013AA
47 Lithuania SEPA LT LT121000011101001000
48 Luxembourg SEPA LU LU280019400644750000
49 Macedonia MK MK07300000000042425
50 Madagascar MG MG4600005030010101914016056
51 Malta SEPA MT MT84MALT011000012345MTLCAST001S
52 Mauritania MR MR1300012000010000002037372
53 Mauritius MU MU17BOMM0101101030300200000MUR
54 Mali ML ML03D00890170001002120000447
55 Moldova MD MD24AG000225100013104168
56 Monaco SEPA MC MC5813488000010051108001292
57 Montenegro ME ME25505000012345678951
58 Mozambique MZ MZ59000100000011834194157
59 Netherlands SEPA NL NL91ABNA0417164300
60 Norway SEPA NO NO9386011117947
61 Pakistan PK PK24SCBL0000001171495101
62 Palestine PS PS92PALS000000000400123456702
63 Poland SEPA PL PL27114020040000300201355387
64 Portugal SEPA PT PT50000201231234567890154
65 Qatar QA QA58DOHB00001234567890ABCDEFG
66 Republic of Kosovo XK XK051212012345678906
67 Romania SEPA RO RO49AAAA1B31007593840000
68 San Marino SEPA SM SM86U0322509800000000270100
69 Saudi Arabia SA SA0380000000608010167519
70 Senegal SN SN12K00100152000025690007542
71 Serbia RS RS35260005601001611379
72 Slovakia SEPA SK SK3112000000198742637541
73 Slovenia SEPA SI SI56191000000123438
74 Spain SEPA ES ES9121000418450200051332
75 Sweden SEPA SE SE3550000000054910000003
76 Switzerland SEPA CH CH9300762011623852957
77 Tunisia TN TN5914207207100707129648
78 Turkey TR TR330006100519786457841326
79 United Arab Emirates AE AE260211000000230064016
80 United Kingdom SEPA GB GB29NWBK60161331926819
81 Virgin Islands, British VG VG96VPVG0000012345678901

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: