-}, "Please specify a valid bank account number" );
-
-$.validator.addMethod( "bankorgiroaccountNL", function( value, element ) {
- return this.optional( element ) ||
- ( $.validator.methods.bankaccountNL.call( this, value, element ) ) ||
- ( $.validator.methods.giroaccountNL.call( this, value, element ) );
-}, "Please specify a valid bank or giro account number" );
-
-/**
- * BIC is the business identifier code (ISO 9362). This BIC check is not a guarantee for authenticity.
- *
- * BIC pattern: BBBBCCLLbbb (8 or 11 characters long; bbb is optional)
- *
- * Validation is case-insensitive. Please make sure to normalize input yourself.
- *
- * BIC definition in detail:
- * - First 4 characters - bank code (only letters)
- * - Next 2 characters - ISO 3166-1 alpha-2 country code (only letters)
- * - Next 2 characters - location code (letters and digits)
- * a. shall not start with '0' or '1'
- * b. second character must be a letter ('O' is not allowed) or digit ('0' for test (therefore not allowed), '1' denoting passive participant, '2' typically reverse-billing)
- * - Last 3 characters - branch code, optional (shall not start with 'X' except in case of 'XXX' for primary office) (letters and digits)
- */
-$.validator.addMethod( "bic", function( value, element ) {
- return this.optional( element ) || /^([A-Z]{6}[A-Z2-9][A-NP-Z1-9])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test( value.toUpperCase() );
-}, "Please specify a valid BIC code" );
-
-/*
- * Código de identificación fiscal ( CIF ) is the tax identification code for Spanish legal entities
- * Further rules can be found in Spanish on http://es.wikipedia.org/wiki/C%C3%B3digo_de_identificaci%C3%B3n_fiscal
- *
- * Spanish CIF structure:
- *
- * [ T ][ P ][ P ][ N ][ N ][ N ][ N ][ N ][ C ]
- *
- * Where:
- *
- * T: 1 character. Kind of Organization Letter: [ABCDEFGHJKLMNPQRSUVW]
- * P: 2 characters. Province.
- * N: 5 characters. Secuencial Number within the province.
- * C: 1 character. Control Digit: [0-9A-J].
- *
- * [ T ]: Kind of Organizations. Possible values:
- *
- * A. Corporations
- * B. LLCs
- * C. General partnerships
- * D. Companies limited partnerships
- * E. Communities of goods
- * F. Cooperative Societies
- * G. Associations
- * H. Communities of homeowners in horizontal property regime
- * J. Civil Societies
- * K. Old format
- * L. Old format
- * M. Old format
- * N. Nonresident entities
- * P. Local authorities
- * Q. Autonomous bodies, state or not, and the like, and congregations and religious institutions
- * R. Congregations and religious institutions (since 2008 ORDER EHA/451/2008)
- * S. Organs of State Administration and regions
- * V. Agrarian Transformation
- * W. Permanent establishments of non-resident in Spain
- *
- * [ C ]: Control Digit. It can be a number or a letter depending on T value:
- * [ T ] --> [ C ]
- * ------ ----------
- * A Number
- * B Number
- * E Number
- * H Number
- * K Letter
- * P Letter
- * Q Letter
- * S Letter
- *
- */
-$.validator.addMethod( "cifES", function( value, element ) {
- "use strict";
-
- if ( this.optional( element ) ) {
- return true;
- }
-
- var cifRegEx = new RegExp( /^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/gi );
- var letter = value.substring( 0, 1 ), // [ T ]
- number = value.substring( 1, 8 ), // [ P ][ P ][ N ][ N ][ N ][ N ][ N ]
- control = value.substring( 8, 9 ), // [ C ]
- all_sum = 0,
- even_sum = 0,
- odd_sum = 0,
- i, n,
- control_digit,
- control_letter;
-
- function isOdd( n ) {
- return n % 2 === 0;
- }
-
- // Quick format test
- if ( value.length !== 9 || !cifRegEx.test( value ) ) {
- return false;
- }
-
- for ( i = 0; i < number.length; i++ ) {
- n = parseInt( number[ i ], 10 );
-
- // Odd positions
- if ( isOdd( i ) ) {
-
- // Odd positions are multiplied first.
- n *= 2;
-
- // If the multiplication is bigger than 10 we need to adjust
- regex = "^[" + symbol + "([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$";
- regex = new RegExp( regex );
- return this.optional( element ) || regex.test( value );
-
-}, "Please specify a valid currency" );
-
-$.validator.addMethod( "dateFA", function( value, element ) {
- return this.optional( element ) || /^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test( value );
-}, $.validator.messages.date );
-
-/**
- * Return true, if the value is a valid date, also making this formal check dd/mm/yyyy.
- // Calculate the result of: ibancheckdigits % 97
- for ( p = 0; p < ibancheckdigits.length; p++ ) {
- cChar = ibancheckdigits.charAt( p );
- cOperator = "" + cRest + "" + cChar;
- cRest = cOperator % 97;
- }
- return cRest === 1;
-}, "Please specify a valid IBAN" );
-
-$.validator.addMethod( "integer", function( value, element ) {
- return this.optional( element ) || /^-?\d+$/.test( value );
-}, "A positive or negative non-decimal number please" );
-
-$.validator.addMethod( "ipv4", function( value, element ) {
- return this.optional( element ) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test( value );
-}, "Please enter a valid IP v4 address." );
-
-$.validator.addMethod( "ipv6", function( value, element ) {
- return this.optional( element ) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test( value );
-}, "Please enter a valid IP v6 address." );
-
-$.validator.addMethod( "lettersonly", function( value, element ) {
- return this.optional( element ) || /^[a-z]+$/i.test( value );
-}, "Letters only please" );
-
-$.validator.addMethod( "letterswithbasicpunc", function( value, element ) {
- return this.optional( element ) || /^[a-z\-.,()'"\s]+$/i.test( value );
-}, "Letters or punctuation only please" );
-
-$.validator.addMethod( "mobileNL", function( value, element ) {
- return this.optional( element ) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test( value );
-}, "Please specify a valid mobile number" );
-
-/* For UK phone functions, do the following server side processing:
- * Compare original input with this RegEx pattern:
-$.validator.addMethod( "netmask", function( value, element ) {
- return this.optional( element ) || /^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test( value );
-}, "Please enter a valid netmask." );
-
-/*
- * The NIE (Número de Identificación de Extranjero) is a Spanish tax identification number assigned by the Spanish
- * authorities to any foreigner.
- *
- * The NIE is the equivalent of a Spaniards Número de Identificación Fiscal (NIF) which serves as a fiscal
- * identification number. The CIF number (Certificado de Identificación Fiscal) is equivalent to the NIF, but applies to
- * companies rather than individuals. The NIE consists of an 'X' or 'Y' followed by 7 or 8 digits then another letter.
- */
-$.validator.addMethod( "nieES", function( value, element ) {
- "use strict";
-
- if ( this.optional( element ) ) {
- return true;
- }
-
- var nieRegEx = new RegExp( /^[MXYZ]{1}[0-9]{7,8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/gi );
- var validChars = "TRWAGMYFPDXBNJZSQVHLCKET",
- letter = value.substr( value.length - 1 ).toUpperCase(),
- number;
-
- value = value.toString().toUpperCase();
-
- // Quick format test
- if ( value.length > 10 || value.length < 9 || !nieRegEx.test( value ) ) {
-$.validator.addMethod( "postalcodeBR", function( cep_value, element ) {
- return this.optional( element ) || /^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test( cep_value );
-}, "Informe um CEP válido." );
-
-/**
- * Matches a valid Canadian Postal Code
- *
- * @example jQuery.validator.methods.postalCodeCA( "H0H 0H0", element )
- * @result true
- *
- * @example jQuery.validator.methods.postalCodeCA( "H0H0H0", element )
- * @result false
- *
- * @name jQuery.validator.methods.postalCodeCA
- * @type Boolean
- * @cat Plugins/Validate/Methods
- */
-$.validator.addMethod( "postalCodeCA", function( value, element ) {
- return this.optional( element ) || /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test( value );
-}, "Please specify a valid postal code" );
-
-/* Matches Italian postcode (CAP) */
-$.validator.addMethod( "postalcodeIT", function( value, element ) {
- return this.optional( element ) || /^\d{5}$/.test( value );
-}, "Please specify a valid postal code" );
-
-$.validator.addMethod( "postalcodeNL", function( value, element ) {
- return this.optional( element ) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test( value );
-}, "Please specify a valid postal code" );
-
-// Matches UK postcode. Does not match to UK Channel Islands that have their own postcodes (non standard UK)
-$.validator.addMethod( "postcodeUK", function( value, element ) {
- return this.optional( element ) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test( value );
-}, "Please specify a valid UK postcode" );
-
-/*
- * Lets you say "at least X inputs that match selector Y must be filled."
- *
- * The end result is that neither of these inputs:
-}, $.validator.format( "Please enter at least {0} characters" ) );
-
-$.validator.addMethod( "time", function( value, element ) {
- return this.optional( element ) || /^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test( value );
-}, "Please enter a valid time, between 00:00 and 23:59" );
-
-$.validator.addMethod( "time12h", function( value, element ) {
- return this.optional( element ) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test( value );
-}, "Please enter a valid time in 12-hour am/pm format" );
-
-// Same as url, but TLD is optional
-$.validator.addMethod( "url2", function( value, element ) {
- return this.optional( element ) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test( value );
-}, $.validator.messages.url );
-
-/**
- * Return true, if the value is a valid vehicle identification number (VIN).
-$.extend( $.expr.pseudos || $.expr[ ":" ], { // '|| $.expr[ ":" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support
- if ( element.nodeName.toLowerCase() === "select" ) {
-
- // Could be an array for select-multiple or a string, both are fine this way
- var val = $( element ).val();
- return val && val.length > 0;
- }
- if ( this.checkable( element ) ) {
- return this.getLength( value, element ) > 0;
- }
- return value.length > 0;
- },
-
- // https://jqueryvalidation.org/email-method/
- email: function( value, element ) {
-
- // From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address
- // Retrieved 2014-01-14
- // If you have a problem with this implementation, report a bug against the above spec
- // Or use custom methods to implement your own email validation
- return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value );
- },
-
- // https://jqueryvalidation.org/url-method/
- url: function( value, element ) {
-
- // Copyright (c) 2010-2013 Diego Perini, MIT licensed
- // https://gist.github.com/dperini/729294
- // see also https://mathiasbynens.be/demo/url-regex
- // modified to allow protocol-relative URLs
- return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value );
- },
-
- // https://jqueryvalidation.org/date-method/
- date: function( value, element ) {
- return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() );
- },
-
- // https://jqueryvalidation.org/dateISO-method/
- dateISO: function( value, element ) {
- return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value );
- },
-
- // https://jqueryvalidation.org/number-method/
- number: function( value, element ) {
- return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value );
- },
-
- // https://jqueryvalidation.org/digits-method/
- digits: function( value, element ) {
- return this.optional( element ) || /^\d+$/.test( value );