File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 22 * Brazillian value number (Cadastrado de Pessoas Juridica).
33 * value numbers have 14 digits in total: 12 numbers followed by 2 check numbers that are being used for validation.
44 */
5- $ . validator . addMethod ( "cnpjBR" , function ( value ) {
5+ $ . validator . addMethod ( "cnpjBR" , function ( value , element ) {
6+ "use strict" ;
7+
8+ if ( this . optional ( element ) ) {
9+ return true ;
10+ }
611
712 // Removing no number
813 value = value . replace ( / [ ^ \d ] + / g, "" ) ;
Original file line number Diff line number Diff line change 22 * Brazillian CPF number (Cadastrado de Pessoas Físicas) is the equivalent of a Brazilian tax registration number.
33 * CPF numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation.
44 */
5- $ . validator . addMethod ( "cpfBR" , function ( value ) {
5+ $ . validator . addMethod ( "cpfBR" , function ( value , element ) {
6+ "use strict" ;
7+
8+ if ( this . optional ( element ) ) {
9+ return true ;
10+ }
611
712 // Removing special characters from value
813 value = value . replace ( / ( [ ~ ! @ # $ % ^ & * ( ) _ + = ` { } \[ \] \- | \\ : ; ' < > , . \/ ? ] ) + / g, "" ) ;
You can’t perform that action at this time.
0 commit comments