Skip to content

Commit 5df9a38

Browse files
committed
Merge pull request victorjonsson#300 from etcho/master
Correcting a couple variables with wrong name on brazil module
2 parents a77db7d + 49866f2 commit 5df9a38

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

form-validator/brazil.dev.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ $.formUtils.addValidator({
3737
for (i=1; i<=9; i++) {
3838
sum1 += parseInt(cpf.substring(i - 1, i)) * (11 - i);
3939
}
40-
remainder1 = (sum * 10) % 11;
40+
remainder1 = (sum1 * 10) % 11;
4141
if (remainder1 >= 10) {
4242
remainder1 = 0;
4343
}
44-
if (remainder != parseInt(cpf.substring(9, 10))) {
44+
if (remainder1 != parseInt(cpf.substring(9, 10))) {
4545
return false;
4646
}
4747

4848
// check 2nd verification digit
4949
for (i = 1; i <= 10; i++) {
50-
sum2 += parseInt(strCPF.substring(i - 1, i)) * (12 - i);
50+
sum2 += parseInt(cpf.substring(i - 1, i)) * (12 - i);
5151
}
5252
remainder2 = (sum2 * 10) % 11;
5353
if (remainder2 >= 10) {
5454
remainder2 = 0;
5555
}
56-
if (remainder2 != parseInt(strCPF.substring(10, 11))) {
56+
if (remainder2 != parseInt(cpf.substring(10, 11))) {
5757
return false;
5858
}
5959

form-validator/brazil.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)