title: Onblur event in a for loop
body: <p>I am trying to submit  HTML forms whenever a text input is entered so I have- </p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
  
      $("#HA15CRNK13").blur(function() { 
      $("#HA15CRNK13A").submit();
      });
  
      $("#HA15VSPS13").blur(function() {
      $("#HA15VSPS13A").submit();
      });   
  
      &lt;/script&gt;
  </code></pre>
  
  <p>The above works. However, I will like to achieve the same result in a for loop i.e </p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
      var T = ['#HA15CRNK13','#HA15VSPS13'];
      var arrayLength = T.length;
  
      for (var i = 0; i &lt; arrayLength; i++)
      {   
          var J = '"'+ T[i]+'"';      // id of input text element
          var P = '"'+ T[i]+'A'+'"'; // id of the form to submit
          $(J).blur(function() {
          $(P).submit();
          });
      }
      &lt;/script&gt;
  </code></pre>
  
  <p>The above doesn't work. How do I go about this? Thanks. </p>