How to parse input[] values and put them into a Javascript Array
<p>Let's say i have this:</p>

<pre><code>&lt;form id='foo'&gt;
 &lt;input name='bar[name]' /&gt;
 &lt;input name='bar[age]' /&gt;
&lt;/form&gt;
</code></pre>

<p>How can i get the values of array inputs within the form <code>foo</code> and put them into an associative array/object like this:</p>

<pre><code>var result = {bar:{name:'blah',age:21}};
</code></pre>

<p>P.S. I don't want to use any frameworks for this.</p>
