How to update document object value in loop (Javascript)
<p>Hi folks i am a beginer to Java script so appologies if this is a dumb question.
I am trying to put the following in a for loop but I can't seem to get it to work. </p>

<p>if (rowID==1) 
    {
        document.form1.class_titleDis_1.value=class_title;
    }
if (rowID==2) 
    {
        document.form1.class_titleDis_2.value=class_title;</p>

<pre><code>}
</code></pre>

<p>This is what I tried</p>

<pre><code>var i=1;
for (i=1;i&lt;=2;i++)
{
  document.form1.(class_titleDis_)+i.value=class_title;
}
</code></pre>

<p>I would be really grateful for any suggestions. 
Graham</p>
