id validator

Validate an identification number

Options

Using with form field

* presents a required option. The HTML attributes are used to set the validator options via the Declarative plugin

Name HTML attribute Type Description
country* data-fv-id___country String or Function An ISO-3166 country code
message data-fv-id___message String The error message

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

# Country Abbreviation ID system Country code Sample ID Is it valid?
1 Argentinia DNI AR 2012345699
2 Bosnia and Herzegovina JMBG BA 0101006500006
3 Brazil CPF BR 231.002.999-00
4 Bulgari EGN BG 8019010008
5 Chile RUN/RUT CL 9260865-3
6 China RIC CN 999999199304070016
7 Colombia NIT CO 2131234325
8 Croatia OIB HR 33392005961
9 Czech RC CZ 590312123
10 Denmark CPR DK 2110625629
11 Estonia isikukood EE 37605030299
12 Finland HETU FI 311280-888Y
13 France NIR FR 253072B07300470
14 Hong Kong HKID HK Y838437B
15 Iceland Kennitala IS 1201743389
16 India Aadhaar ID 496858245153
17 Ireland PPS IE 6433435E
18 Israel Mispar Zehut IL 231740705
19 Korea RRN KR 8405206403450
20 Latvia Personas kods LV 161175-19997
21 Lithuania Asmens kodas LT 38703181746
22 Macedonia ЕМБГ MK 0101006430038
23 Malaysia NRIC MY 771305021234
24 Mexico CURP MX BOXW310820HNERXN08
25 Montenegro JMBG ME 0101006220276
26 Netherlands BSN NL 111222333
27 Norway Fødselsnummer NO 68413152113
28 Peru CUI PE 434518267
29 Poland PESEL PL 87123116221
30 Romania CNP RO 1630615123457
31 San Marino - SM 24792
32 Serbia JMBG RS 0101006750045
33 Slovakia RC SK 7103192745
34 Slovenia EMŠO SI 0101006500006
35 South Africa South African ID ZA 8001015009087
36 Spain DNI/NIE/CIF ES X-2482300A
37 Sweden personnummer SE 811228+9874
38 Switzerland AHV-Nr/No AVS CH 7561234567895
39 Taiwan - TW J249349093
40 Thailand - TH 1100800092310
41 Uruguay - UY 12345673

Using with ES6 module

Basic Example

You can click on sample from the table above to see if it's a valid or invalid id.

ES6 Module Example

The following snippet shows how to use the id validator with ES6 module:

More examples

Related validators

The following validators might be useful to you.