![]() Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : fdshops ( 1003) PHP Version : 8.2.21 Disable Function : NONE Directory : /home/fdshops/public_html/resources/plugins/jquery-validation-1.16.0/src/additional/ |
/* * 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." );