title: Repetited tasks inserted into Javascript loop
body: <p>I have to run several times a Javascript function in order to update up than 100 forms.</p>
  
  <p>So far, the following works perfectly but i have to individually call the function for each ID i want to update :</p>
  
  <pre><code>setSelectedIndex(document.getElementById("schedule_1"),"~maj_sensor_schedule(1)~");
  setSelectedIndex(document.getElementById("schedule_2"),"~maj_sensor_schedule(2)~");
  setSelectedIndex(document.getElementById("schedule_3"),"~maj_sensor_schedule(3)~");
  
  . . .
  
  setSelectedIndex(document.getElementById("schedule_99"),"~maj_sensor_schedule(99)~");
  setSelectedIndex(document.getElementById("schedule_100"),"~maj_sensor_schedule(100)~");
  </code></pre>
  
  <p>I would like to insert the function into a loop to automize the update process, tried the following but it won't work :</p>
  
  <pre><code>for(i = 1; i &lt; 100+1 ; i++)
  setSelectedIndex(document.getElementById("schedule_"+i),"~maj_sensor_schedule("+i")~");
  </code></pre>
  
  <p>Would you please tell me what is wrong ?</p>
  
  <p>Many thanks</p>