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 7523169263
5 Chile RUN/RUT CL 12937893-K
6 China RIC CN 110108601017023
7 Colombia NIT CO 2131234321
8 Croatia OIB HR 33392005962
9 Czech RC CZ 991231123
10 Denmark CPR DK 2110625629
11 Estonia isikukood EE 37605030299
12 Finland HETU FI 131052-308U
13 France NIR FR 253072C07300443
14 Hong Kong HKID HK P5537227
15 Iceland Kennitala IS 0902862349
16 India Aadhaar ID 643343121
17 Ireland PPS IE 1234567TW
18 Israel Mispar Zehut IL 39337422
19 Korea RRN KR 780206-1000824
20 Latvia Personas kods LV 161375-19997
21 Lithuania Asmens kodas LT 38703181746
22 Macedonia ЕМБГ MK 0101006410007
23 Malaysia NRIC MY 771305021234
24 Mexico CURP MX HEGG560427MVZRRL04
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 04271113861
30 Romania CNP RO 8800101221144
31 San Marino - SM 89145
32 Serbia JMBG RS 0101006750038
33 Slovakia RC SK 1103492745
34 Slovenia EMŠO SI 0101006500007
35 South Africa South African ID ZA 8001015009086
36 Spain DNI/NIE/CIF ES 54362315-K
37 Sweden personnummer SE 811228+9874
38 Switzerland AHV-Nr/No AVS CH 756.1234.5678.95
39 Taiwan - TW J249349093
40 Thailand - TH 3688699975685
41 Uruguay - UY 12345672

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

Changelog

  • v1.7.0: Fixed an issue that the South African identification validator doesn't work with the minified version
  • v1.6.0: Fixed an issue that the country option isn't passed to the placeholder message

Related validators

The following validators might be useful to you.