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 20.123.456
2 Bosnia and Herzegovina JMBG BA 0101006500006
3 Brazil CPF BR 000.000.000-00
4 Bulgari EGN BG 8001010008
5 Chile RUN/RUT CL 12531909-2
6 China RIC CN 999999199304070016
7 Colombia NIT CO 213.123.432-1
8 Croatia OIB HR 33392005962
9 Czech RC CZ 590312123
10 Denmark CPR DK 211062-5629
11 Estonia isikukood EE 37605030291
12 Finland HETU FI 131052-308U
13 France NIR FR 253072A07300443
14 Hong Kong HKID HK R2496896
15 Iceland Kennitala IS 0902862349
16 India Aadhaar ID 234123412346
17 Ireland PPS IE 6433435FT
18 Israel Mispar Zehut IL 339677395
19 Korea RRN KR 701112-2606161
20 Latvia Personas kods LV 161175-19997
21 Lithuania Asmens kodas LT 38703181746
22 Macedonia ЕМБГ MK 0101006420216
23 Malaysia NRIC MY 771305021234
24 Mexico CURP MX BOXW310820HNERXN08
25 Montenegro JMBG ME 0101006210008
26 Netherlands BSN NL 941331490
27 Norway Fødselsnummer NO 68413152113
28 Peru CUI PE 101174102
29 Poland PESEL PL 36032806768
30 Romania CNP RO 1630615123458
31 San Marino - SM 24792
32 Serbia JMBG RS 0101006701001
33 Slovakia RC SK 7103192746
34 Slovenia EMŠO SI 010100650000
35 South Africa South African ID ZA 8001015009087
36 Spain DNI/NIE/CIF ES X-2482300A
37 Sweden personnummer SE 8112289874
38 Switzerland AHV-Nr/No AVS CH 756.1234.5678.95
39 Taiwan - TW X233583559
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.