i have this function:
[CODE]
function suma(uno, dos, tres, cuatro, cinco, seis){
if(uno.length < 1)
uno = 0;
if(dos.length < 1)
dos = 0;
if(tres.length < 1)
tres = 0;
if(cuatro.length < 1)
cuatro = 0;
if(cinco.length < 1)
cinco = 0;
if(seis.length < 1)
seis = 0;
res = 0;
res = uno + dos + tres + cuatro + cinco + seis;
if(res == 100)
return true;
else
return false;
}
I call taht funcion like this:
[CODE]
function validateForm(f){
…
(!suma(f.compraingram.value, f.comprasynnex.value, f.compramexmal.value, f.compracentel.value, f.compramaps.value, f.compraotro.value))
? showImage(“compra”, “estrella.gif”, true)
: showImage(“compra”, “empty.gif”, false);
…
}
my form look like this:
[CODE]<form name=”form1″ method=”post” action=”preregistro3.php” onSubmit=”return validateForm(this)”>
The problem is that my function suma always return false…
I notice that my variable ‘var’ never match if i use add but it match if i use / or *
any idea on what i am doing wrong?
Thx