There is a sequence of ProdCode fields; in this case 1 - 3. I would like to populate the strCBFilter variable with the values contained in those fields using a loop:
The code creates each name by concatenating the number in the loop to the
prefix: document.frmXRe fAttachMaint_01 .ProdCode". Is there a way to have the program do this:
using the value of variable strCBFilterCode which contains:
document.frmXRe fAttachMaint_01 .ProdCode1 with the number changing each time through the loop.
Full Code:
//The highlighted code populates the strCBFilter variable with the contents of the strCBFilterCode variable instead of the field the strCBFilterCode variable refers to. In other languages, I was able to execute commands after placing them in variables. Can this be done in Javascript?//
Code:
document.frmXRefAttachMaint_01.ProdCode1 document.frmXRefAttachMaint_01.ProdCode2 document.frmXRefAttachMaint_01.ProdCode3
prefix: document.frmXRe fAttachMaint_01 .ProdCode". Is there a way to have the program do this:
Code:
strCBFilter = strCBFilter + document.frmXRefAttachMaint_01.ProdCode1
document.frmXRe fAttachMaint_01 .ProdCode1 with the number changing each time through the loop.
Full Code:
Code:
for(i = 1; i < 4; i++)
{
var strCBFilterCode = "document.frmXRefAttachMaint_01.ProdCode" + i + ".value";
[B]strCBFilter = strCBFilter + strCBFilterCode[/B]
}
Comment