C
ckerns
I have a form with 40 text boxes (default of each = 0). I want to
evaluate each box to see if the value is still zero, and if it is, I
want to add it to a "Zero Count". The box names are "L411 thru L419",
"L421 thru L429", "L431 thru L439" and "L441 thru L449".
Example:
L41 - 002000500
L42 - 000030000
L43 - 000000000
L44 - 000000000
I have construct the control name thru a couple of nested for loops
and all is well (constructed string = "MyForm.L411.value").
When I plug this into an If statement to get the value of the control,
everything dies. Here is my If:
for(var j = 1; j < 5; j++)
{
rowString = "L4";
// builds L41
rowString = rowString + j;
for(var x = 1; x < 10; x++)
{
// builds L411
rowString = rowString + x;
// Builds MyForm.L411.value
rowString = "MyForm." + rowString + ".value"
//alert shows "MyForm.L411.value" - without quotes
//alert(rowString);
if( rowString = "0")
{
zeroCount++:
}
rowString = "L4" + j;
}
}
How can I test the value of a control, based on a string built?
Many tia's
ck
evaluate each box to see if the value is still zero, and if it is, I
want to add it to a "Zero Count". The box names are "L411 thru L419",
"L421 thru L429", "L431 thru L439" and "L441 thru L449".
Example:
L41 - 002000500
L42 - 000030000
L43 - 000000000
L44 - 000000000
I have construct the control name thru a couple of nested for loops
and all is well (constructed string = "MyForm.L411.value").
When I plug this into an If statement to get the value of the control,
everything dies. Here is my If:
for(var j = 1; j < 5; j++)
{
rowString = "L4";
// builds L41
rowString = rowString + j;
for(var x = 1; x < 10; x++)
{
// builds L411
rowString = rowString + x;
// Builds MyForm.L411.value
rowString = "MyForm." + rowString + ".value"
//alert shows "MyForm.L411.value" - without quotes
//alert(rowString);
if( rowString = "0")
{
zeroCount++:
}
rowString = "L4" + j;
}
}
How can I test the value of a control, based on a string built?
Many tia's
ck