OAuth OK!
This commit is contained in:
parent
494a840f70
commit
567e4a6635
382 changed files with 52478 additions and 7572 deletions
25
testOauthClient/wwwroot/lib/jquery-validation/src/additional/nifES.js
vendored
Normal file
25
testOauthClient/wwwroot/lib/jquery-validation/src/additional/nifES.js
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* The Número de Identificación Fiscal ( NIF ) is the way tax identification used in Spain for individuals
|
||||
*/
|
||||
$.validator.addMethod( "nifES", function( value ) {
|
||||
"use strict";
|
||||
|
||||
value = value.toUpperCase();
|
||||
|
||||
// Basic format test
|
||||
if ( !value.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)") ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Test NIF
|
||||
if ( /^[0-9]{8}[A-Z]{1}$/.test( value ) ) {
|
||||
return ( "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.substring( 8, 0 ) % 23 ) === value.charAt( 8 ) );
|
||||
}
|
||||
// Test specials NIF (starts with K, L or M)
|
||||
if ( /^[KLM]{1}/.test( value ) ) {
|
||||
return ( value[ 8 ] === String.fromCharCode( 64 ) );
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}, "Please specify a valid NIF number." );
|
||||
Loading…
Add table
Add a link
Reference in a new issue