I have put my project files below. This needs to be done in a different JS file with all code following the requirements along with my HTML code that is given. Please and thank you very much. ( please...

1 answer below »
I have put my project files below. This needs to be done in a different JS file with all code following the requirements along with my HTML code that is given. Please and thank you very much. ( please ignore the refreences for the assignment)
Answered Same DayFeb 18, 2021

Answer To: I have put my project files below. This needs to be done in a different JS file with all code...

Valupadasu answered on Feb 19 2021
147 Votes
script.js
function testLength(value,length){
return value.length == length ? true : false;
}

function testNumber(value){
return !isNaN(value);
}
function validateControl(control, name, length){
if(testLength(control.value, length)){
if(testNumber(control.value)){
return true;
}else{
alert('The control '+name+' is not of number type');
}
}else{
alert('The control '+name+' length validation failed');
}
return false;
}
function validateCreditCard(value){
value = value.trim();
if(testNumber(value)){
var FirstDigit = value.toString()[0];
if(FirstDigit == 3 || FirstDigit == 4 || FirstDigit == 5 || FirstDigit == 6){
var cardLength = 0;
if(FirstDigit == 3){
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here