C
ckerns
I want to loop thru an array of controls,(39 of them...defaults = 0).
If value is null or non-numeric I want to assign the value of "0".
rowString = "L411" //conrol name
if (isNaN(eval ("document.forms[0]."+rowString+".value")) == true )
{
//this alert works if the value is a letter,i.e,"a"
alert("You have entered an non-numeric value.\nEnter a number
in the appropriate box.");
//If I leave this in the code dies
//document.forms[0]." + rowString + ".value = 0;
}
I've played with this, but no luck.
if (isNaN(eval ("document.forms[0]."+rowString+".value")) == true ||
isEmpty(eval ("document.forms[0]."+rowString+".value")) == true )
{
//this alert works if the value is a letter,i.e,"a"
alert("You have entered an non-numeric value.\nEnter a number
in the appropriate box.");
//If I leave this in the code dies
//document.forms[0]." + rowString + ".value = 0;
}
Any hints here?
Thansk
ck
If value is null or non-numeric I want to assign the value of "0".
rowString = "L411" //conrol name
if (isNaN(eval ("document.forms[0]."+rowString+".value")) == true )
{
//this alert works if the value is a letter,i.e,"a"
alert("You have entered an non-numeric value.\nEnter a number
in the appropriate box.");
//If I leave this in the code dies
//document.forms[0]." + rowString + ".value = 0;
}
I've played with this, but no luck.
if (isNaN(eval ("document.forms[0]."+rowString+".value")) == true ||
isEmpty(eval ("document.forms[0]."+rowString+".value")) == true )
{
//this alert works if the value is a letter,i.e,"a"
alert("You have entered an non-numeric value.\nEnter a number
in the appropriate box.");
//If I leave this in the code dies
//document.forms[0]." + rowString + ".value = 0;
}
Any hints here?
Thansk
ck