Validators / vat

Edit on Github

Validate VAT number. Support 32 countries.

Option Equivalent HTML attribute Type Description
message data-bv-vat-message String The error message
country data-bv-vat-country String A ISO 3166 country code. If it is not defined, it will be parsed from the VAT number.

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

No. Country Abbreviation VAT name Country code Example
1 Austria UID AT
2 Belgium n° TVA / BTW-nr / Mwst-nr BE
3 Bulgaria ДДС номер BG
4 Croatia PDV-ID; OIB HR
5 Cyprus ΦΠΑ CY
6 Czech Republic DIČ CZ
7 Denmark CVR DK
8 Estonia KMKR EE
9 Finland ALV nro FI
10 France n° TVA FR
11 Germany USt-IdNr. DE
12 Greece ΑΦΜ GR / EL
13 Hungary ANUM HU
14 Ireland VAT no IE
15 Italy P.IVA IT
16 Latvia PVN LV
17 Lithuania PVM kodas LT
18 Luxembourg No. TVA LU
19 Malta Vat No. MT
20 Netherlands Btw-nr. NL
21 Norway Orgnr NO
22 Poland NIP PL
23 Portugal NIF / NIPC PT
24 Romania CIF RO
25 Russia ИНН RU
26 Serbia PIB RS
27 Slovakia IČ DPH SK
28 Slovenia ID za DDV SI
29 Spain NIF / CIF ES
30 Sweden Momsnr. SE
31 Switzerland MWST / TVA / IVA CH
32 United Kingdom VAT Reg No GB

Example

<form id="vatForm" class="form-horizontal">
    <div class="form-group">
        <label class="col-lg-3 control-label">VAT number</label>
        <div class="col-lg-5">
            <input type="text" class="form-control" name="vat" />
        </div>
    </div>
</form>
<script>
$(document).ready(function() {
    $('#vatForm').bootstrapValidator({
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            vat: {
                validators: {
                    vat: {
                        message: 'The VAT number is not valid'
                    }
                }
            }
        }
    });
});
</script>

Comments

If you want to report a bug, please submit the issue on Github. Do NOT post the issue here.

For a general question or feedback, use the form below.