Store a bunch of inputs on page into a javascript array?
<p>I have a bunch of inputs on a page, ie:</p>

<pre><code>&lt;input name="user[name]" /&gt;
&lt;input name="user[phone]" /&gt;
&lt;input name="user[email]" /&gt;
</code></pre>

<p>And what I'd like to do, is on submitting the form is grab all those variables of the user array and store them in a javascript array.</p>

<p>Ie, I would think something like this would work:</p>

<pre><code>$('submit').click(function(e){

 e.preventDefault;


 $.each($('input[name=user*') as var) {

     var user[] = this.input value etc;

  }

});
</code></pre>

<p>But thats because I don't know much about javascript arrays.</p>

<p>How is this sort of thing achieved?</p>
