Javascript Dynamic? Variables

Joined: 11/28/2008

Hello, I am trying to something like the following in javascript and I am stuck.

CODE
for(i=0; document.FORM1.TOTLOANS.value > i; i++){
totalpropcom=totalpropcom + ((Number(document.FORM1.PROPCOM{i}.value))*100);
}

I want it to be able to add the fields:
document.FORM1.PROPCOM1.value
document.FORM1.PROPCOM2.value
document.FORM1.PROPCOM3.value
document.FORM1.PROPCOM4.value
document.FORM1.PROPCOM5.value
etc.
This is a dynamic number based on the value of document.FORM1.TOTLOANS.value in my for loop criteria.

The solution, I have tried, didn't work. Any ideas on what is wrong with my code?

Thanks!!

Faithful

Joined: 11/28/2008
Nevermind, I figured it out

Nevermind, I figured it out finally. I did this:

CODE
  totalpropcom=totalpropcom+((Number(document.FORM1['PROPCOM'+j].value))*100);

Works great.