title: getElementById() inside For loop isnt working
body: <p>i have a form which have 39 text input fields. their ids are input1, input2 ... input39. what i want to do is if any of them doesnt contain any value then my script will delete it which is no problem. the problem is when i check the values of those text fields one by one it works fine but when i use a loop it shows error.so i ran a very simple test in the firebug console..</p>
  
  <pre><code>var i=1;
  var asd="";
  
  asd='input' + i;
  var test=document.getElementById(asd).value;
  asd="";
  test;
  </code></pre>
  
  <p>if i run the above code in the firebug console then it works fine, shows the value of 1st textbox. but..</p>
  
  <pre><code>var i=1;
  var asd="";
  
  for(i=1;i&lt;39;i++)
  {
      asd='input' + i;
      var test=document.getElementById(asd).value;
      asd="";
      test;
  }
  </code></pre>
  
  <p>if i run this code then i get <strong>TypeError: document.getElementById(...) is null</strong></p>
  
  <p>any idea why is this happening?? all the textboxes default value is "" (empty string)..</p>