Jquery Javascript Property Undefined
<pre><code>function dadosFormularios() {
    var dadosFormulario = {};
    var iterador = countForms;
    var i = 0;
    while (i &lt; iterador) {
        dadosFormulario[i] = {};
        dadosFormulario[i]['a'] = $('#field\\[' + i + '\\]\\[a\\]').val();
        dadosFormulario[i]['b'] = $('#field\\[' + i + '\\]\\[b\\]').val();
        //alert(dadosFormulario[i]['a']);
        //alert(dadosFormulario[i]['b']);   
        i++;
    }
    var qstring = '';
    var tmp_qstring = [];
    var temp1, temp2;
    var aux_i = i + 1;
    alert(aux_i);
    for (var j = 0; j &lt; aux_i; j++) {
        temp1 = dadosFormulario[j]['a'];
        alert(temp1);
        temp2 = dadosFormulario[j]['b'];
        //alert(temp1);
        tmp_qstring[j] = 'a' + j + '=' + temp1 + '&amp;' + 'b' + j + '=' + temp2;
    }
    qstring = tmp_qstring.join('&amp;');
    alert(qstring);
    window.location = 'dup1.php?' + qstring;
}
</code></pre>

<p>When i click on a button i call the above function and now I'm trying to send the data of the array of objects to another page as you can see in the code.</p>

<p>My problem is that i'm getting trouble when i set <code>dadosFormulario[j]['a'];</code> or <code>dadosFormulario[j]['b'];</code> to a var or set them directly in the <code>tmp_qstring</code> i.e. <code>tmp_qstring[j]=dadosFormulario[j]['b'];</code>. In chrome console i get the error:</p>

<blockquote>
  <p>Uncaught TypeError: Cannot read property 'a' of undefined</p>
</blockquote>
