title: While loop within Javascript function
body: <p>I have the following basic function:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function Form_Data(theForm)
  {
  
  var t=1;
  while (t&lt;=5) {
  
  if (theForm.F[t]FirstName.value == "")
      {
      alert("Please enter Fighter 1's First Name.");
      theForm.F[t]FirstName.focus();
      return (false);
      }
  t++;
  }
  
  return (true);
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>The script (js validation) fails using this code. If I remove the [t] and replace with a number (1,2,3,4,etc), the validation works on the appropriate fields. What am I doing wrong?</p>