I have an IF statement in order to validate some things:
-If the input value is different from either 000000000000000000 (eighthteen zeroes) or 0 (one zero).
-if all the input has the same numbers
-if all the numbers in the input are only 0
Code:
else if((IDProdAIngresar!='000000000000000000'||IDProdAIngresar!='0') && (allEqual(CantidadIngresadaSinPunto)) && CantidadIngresadaSinPunto.indexOf('0') > -1)
{
$("#MSJ").html("Error: La cantidad ingresada no puede ser cero");
$("#ModalMSJ").modal("show");
}
The problem is when the input is either 000000000000000000 (eighthteen zeroes) or 0 (one zero) the error keep showing when it shouldn't.
As I understand,if it's an AND all the validations has to be met for the error to show. However I have no idea why the error keep showing even when the (IDProdAIngresar!='000000000000000000'||IDProdAIngresar!='0')
is not met and the other validations are, as shown in the image bellow:
Thanks in advance!