From b171b76ce523bd432b856a36939509fc9134e582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez?= <45081533+FerMdez@users.noreply.github.com> Date: Tue, 1 Jun 2021 17:33:01 +0200 Subject: [PATCH] Add files via upload --- assets/js/checkPay.js | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/assets/js/checkPay.js b/assets/js/checkPay.js index 11811db..40f9982 100644 --- a/assets/js/checkPay.js +++ b/assets/js/checkPay.js @@ -48,11 +48,8 @@ $(document).ready(function() { $("#card-number-0").change(function(){ const cardNumber0 = $("#card-number-0"); cardNumber0[0].setCustomValidity(""); - cardNumber1[0].setCustomValidity(""); - cardNumber2[0].setCustomValidity(""); - cardNumber3[0].setCustomValidity(""); - if(cardNumber0.val().length < 4){ + if(cardNumber0.val().length === 4){ $("#carNumberValid").show(); $("#cardNumerInvalid").hide(); cardNumber0[0].setCustomValidity(""); @@ -64,12 +61,9 @@ $(document).ready(function() { }); $("#card-number-1").change(function(){ const cardNumber1 = $("#card-number-1"); - cardNumber0[0].setCustomValidity(""); cardNumber1[0].setCustomValidity(""); - cardNumber2[0].setCustomValidity(""); - cardNumber3[0].setCustomValidity(""); - if(cardNumber1.val().length < 4){ + if(cardNumber1.val().length === 4){ $("#carNumberValid").show(); $("#cardNumerInvalid").hide(); cardNumber1[0].setCustomValidity(""); @@ -81,12 +75,9 @@ $(document).ready(function() { }); $("#card-number-2").change(function(){ const cardNumber2 = $("#card-number-2"); - cardNumber0[0].setCustomValidity(""); - cardNumber1[0].setCustomValidity(""); cardNumber2[0].setCustomValidity(""); - cardNumber3[0].setCustomValidity(""); - if(cardNumber2.val().length < 4){ + if(cardNumber2.val().length === 4){ $("#carNumberValid").show(); $("#cardNumerInvalid").hide(); cardNumber2[0].setCustomValidity(""); @@ -98,12 +89,9 @@ $(document).ready(function() { }); $("#card-number-3").change(function(){ const cardNumber3 = $("#card-number-3"); - cardNumber0[0].setCustomValidity(""); - cardNumber1[0].setCustomValidity(""); - cardNumber2[0].setCustomValidity(""); cardNumber3[0].setCustomValidity(""); - if(cardNumber3.val().length < 4){ + if(cardNumber3.val().length === 4){ $("#carNumberValid").show(); $("#cardNumerInvalid").hide(); cardNumber3[0].setCustomValidity("");