I'm far from an expert at JavaScript as you're about to see.

I'm trying to pass an array of values to a series of html form fields.

the data in the array is in the variables dirLen[]

the form fields I'm trying to populate are named
dirLen1
dirLen2
dirLen3
etc...

I can pass individual array values to the individual form fields using:
form.field_name.value=arrayValue
so I know my array is good and that the above syntax works.

I just don't know the format to call the form field in the following for-loop.

// for-loop to populate form fields
for (var k=0;k<=23;k++)
{
form.dirLen[k].value=dirLen[k];
}

I've tried:
form.['dirLen'+k].value=dirLen[k]
form."dirLen"+[k].value=dirLen[k]
form.[dirLen+k].value=dirLen[k]
form.["dirLen"+k].value=dirLen[k]

and lots of others. Any help is appreciated.

-Ryan