OAuth OK!
This commit is contained in:
parent
494a840f70
commit
567e4a6635
382 changed files with 52478 additions and 7572 deletions
25
testOauthClient/wwwroot/lib/jquery-validation/src/additional/bankaccountNL.js
vendored
Normal file
25
testOauthClient/wwwroot/lib/jquery-validation/src/additional/bankaccountNL.js
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Dutch bank account numbers (not 'giro' numbers) have 9 digits
|
||||
* and pass the '11 check'.
|
||||
* We accept the notation with spaces, as that is common.
|
||||
* acceptable: 123456789 or 12 34 56 789
|
||||
*/
|
||||
$.validator.addMethod("bankaccountNL", function(value, element) {
|
||||
if (this.optional(element)) {
|
||||
return true;
|
||||
}
|
||||
if (!(/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(value))) {
|
||||
return false;
|
||||
}
|
||||
// now '11 check'
|
||||
var account = value.replace(/ /g, ""), // remove spaces
|
||||
sum = 0,
|
||||
len = account.length,
|
||||
pos, factor, digit;
|
||||
for ( pos = 0; pos < len; pos++ ) {
|
||||
factor = len - pos;
|
||||
digit = account.substring(pos, pos + 1);
|
||||
sum = sum + factor * digit;
|
||||
}
|
||||
return sum % 11 === 0;
|
||||
}, "Please specify a valid bank account number");
|
||||
Loading…
Add table
Add a link
Reference in a new issue