mirror of
https://github.com/skidoodle/taj-validator.git
synced 2025-03-05 20:00:40 +01:00
final ver
This commit is contained in:
parent
2180538627
commit
efd76b27a2
4 changed files with 13 additions and 28 deletions
|
@ -1,4 +1,3 @@
|
|||
// Input 0
|
||||
function restrictInput(a) {
|
||||
a.value = a.value.replace(/[^0-9]/g, "").slice(0, 9);
|
||||
}
|
||||
|
@ -7,7 +6,7 @@ function validateTAJ(a) {
|
|||
if (9 != a.length) {
|
||||
return !1;
|
||||
}
|
||||
for (var c = 0, d = "", b = 0; b < a.length; b++) {
|
||||
for (var c = 0, d = '', b = 0; b < a.length; b++) {
|
||||
7 >= b && (c += 0 == (b + 1) % 2 ? 7 * parseInt(a[b]) : 3 * parseInt(a[b]), d += a[b]);
|
||||
}
|
||||
return a == d + c % 10;
|
||||
|
@ -19,5 +18,4 @@ function checkTAJ() {
|
|||
c.textContent = a ? "A TAJ sz\u00e1m \u00e9rv\u00e9nyes." : "A TAJ sz\u00e1m \u00e9rv\u00e9nytelen.";
|
||||
c.style.color = a ? "#4CAF50" : "#FF5733";
|
||||
return a;
|
||||
}
|
||||
;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue