Validators / id

Validate identification number. Support 25 countries.

Options

Option HTML attribute Type Description
country* data-bv-id-country String An ISO-3166 country code.
It's dynamic option
message data-bv-id-message String The error message

The validator supports the following countries (click the sample number to validate it):

No. Country Abbreviation ID system Country code Example
1 Bosnia and Herzegovina JMBG BA
2 Brazil CPF BR
39053344705
390.533.447-05
111.444.777-35
231.002.999-00
3 Bulgari EGN BG
7523169263
8032056031
803205 603 1
8001010008
7501020018
7552010005
7542011030
8019010008
4 Chile RUN/RUT CL
76086428-5
22060449-7
12531909-2
5 Croatia OIB HR
33392005961
33392005962
6 Czech RC CZ
7103192745
991231123
1103492745
590312123
7 Denmark CPR DK
2110625629
211062-5629
511062-5629
8 Estonia isikukood EE
37605030299
9 Finland HETU FI
311280-888Y
131052-308T
131052-308U
310252-308Y
10 Iceland Kennitala IS
120174-3399
1201743399
0902862349
11 Ireland PPS IE
6433435F
6433435FT
6433435FW
6433435OA
6433435IH
1234567TW
1234567FA
6433435E
6433435VH
12 Latvia Personas kods LV
161175-19997
16117519997
161375-19997
13 Lithuania Asmens kodas LT
38703181745
38703181746
78703181745
38703421745
14 Macedonia ЕМБГ MK
15 Montenegro JMBG ME
16 Netherlands BSN NL
111222333
941331490
9413.31.490
111252333
17 Romania CNP RO
1630615123457
1800101221144
8800101221144
1632215123457
1630615123458
18 San Marino SM
19 Serbia JMBG RS
20 Slovakia RC SK
7103192745
991231123
7103192746
1103492745
21 Slovenia EMŠO SI
0101006500006
22 South Africa South African ID ZA
8001015009087
8001015009287
8001015009086
23 Spain DNI/NIE ES
54362315K
54362315-K
X2482300W
X-2482300W
X-2482300-W
54362315Z
X-2482300A
24 Sweden personnummer SE
8112289874
811228-9874
811228+9874
811228-9873
25 Switzerland AHV-Nr/No AVS CH
756.1234.5678.95
7561234567895

Example

<form id="idForm" class="form-horizontal">
    <div class="form-group">
        <label class="col-lg-3 control-label">Country</label>
        <div class="col-lg-5">
            <select class="form-control" name="countrySelectBox">
                <option value="BA">Bosnia and Herzegovina</option>
                <option value="BR">Brazil</option>
                <option value="BG">Bulgari</option>
                <option value="CL">Chile</option>
                <option value="HR">Croatia</option>
                <option value="CZ">Czech</option>
                <option value="DK">Denmark</option>
                <option value="EE">Estonia</option>
                <option value="FI">Finland</option>
                <option value="IS">Iceland</option>
                <option value="IE">Ireland</option>
                <option value="LV">Latvia</option>
                <option value="LT">Lithuania</option>
                <option value="MK">Macedonia</option>
                <option value="ME">Montenegro</option>
                <option value="NL">Netherlands</option>
                <option value="RO">Romania</option>
                <option value="SM">San Marino</option>
                <option value="RS">Serbia</option>
                <option value="SK">Slovakia</option>
                <option value="SI">Slovenia</option>
                <option value="ZA">South Africa</option>
                <option value="ES">Spain</option>
                <option value="SE">Sweden</option>
                <option value="CH">Switzerland</option>
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="col-lg-3 control-label">ID</label>
        <div class="col-lg-5">
            <input type="text" class="form-control" name="id" />
        </div>
    </div>
</form>
$(document).ready(function() {
    $('#idForm')
        .bootstrapValidator({
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                id: {
                    validators: {
                        id: {
                            country: 'countrySelectBox',
                            message: 'The value is not valid %s ID'
                        }
                    }
                }
            }
        });
});

The following validators might be useful to you: