title: Using a variable in a DOM string
body: <p>I am trying to put a variable into a dom string. I have various fields as such:</p>
  
  <pre><code>&lt;input type="text" name="itemdesc1" /&gt;
  &lt;input type="text" name="itemdesc2" /&gt; 
  </code></pre>
  
  <p>I want to loop through these to see if they are populated before submit. The only problem I have is that I cannot run them through a loop, because I need to put a variable into the DOM string. The variable is "i".</p>
  
  <pre><code>if (document.insertinv.itemdesc(variable_here).value == ''){
       // Code
  }
  </code></pre>
  
  <p>Is there any specific way to do this? Preferably without adding id's to the fields.</p>
  
  <p>Thanks!</p>