Skip to content

Commit

Permalink
Merge pull request victorjonsson#300 from etcho/master
Browse files Browse the repository at this point in the history
Correcting a couple variables with wrong name on brazil module
  • Loading branch information
victorjonsson committed Sep 12, 2015
2 parents a77db7d + 49866f2 commit 5df9a38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions form-validator/brazil.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@ $.formUtils.addValidator({
for (i=1; i<=9; i++) {
sum1 += parseInt(cpf.substring(i - 1, i)) * (11 - i);
}
remainder1 = (sum * 10) % 11;
remainder1 = (sum1 * 10) % 11;
if (remainder1 >= 10) {
remainder1 = 0;
}
if (remainder != parseInt(cpf.substring(9, 10))) {
if (remainder1 != parseInt(cpf.substring(9, 10))) {
return false;
}

// check 2nd verification digit
for (i = 1; i <= 10; i++) {
sum2 += parseInt(strCPF.substring(i - 1, i)) * (12 - i);
sum2 += parseInt(cpf.substring(i - 1, i)) * (12 - i);
}
remainder2 = (sum2 * 10) % 11;
if (remainder2 >= 10) {
remainder2 = 0;
}
if (remainder2 != parseInt(strCPF.substring(10, 11))) {
if (remainder2 != parseInt(cpf.substring(10, 11))) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion form-validator/brazil.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5df9a38

Please sign in to comment.