Server : LiteSpeed System : Linux premium163.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64 User : infihsqw ( 644) PHP Version : 8.1.29 Disable Function : NONE Directory : /home/infihsqw/starcare-uae.store/old/controlPanel/assets/plugins/jquery-validation/src/additional/ |
/* * The nĂºmero de identidad de extranjero ( NIE )is a code used to identify the non-nationals in Spain */ $.validator.addMethod( "nieES", 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 NIE //T if ( /^[T]{1}/.test( value ) ) { return ( value[ 8 ] === /^[T]{1}[A-Z0-9]{8}$/.test( value ) ); } //XYZ if ( /^[XYZ]{1}/.test( value ) ) { return ( value[ 8 ] === "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.replace( "X", "0" ) .replace( "Y", "1" ) .replace( "Z", "2" ) .substring( 0, 8 ) % 23 ) ); } return false; }, "Please specify a valid NIE number." );