jQuery or JS: Select input fields with 2 level brackets?
<p>I have a dynamic form that adds users to the site, made so you can duplicate the fields to add several users on one go.</p>

<p>So, my  looks like</p>

<pre><code>&lt;input name="user[1][name]" value="" /&gt;
&lt;input name="user[1][username]" value="" /&gt;
&lt;input name="user[1][password]" value="" /&gt;
</code></pre>

<p>And then the number is changed on the duplicated fields, eg:</p>

<pre><code>&lt;input name="user[2][name]" value="" /&gt;
&lt;input name="user[2][username]" value="" /&gt;
&lt;input name="user[2][password]" value="" /&gt;
</code></pre>

<p>and so on.</p>

<p>On PHP I can handle each user since it has it's own array.
But I would like to validate, for example, the username on each user via jQuery.</p>

<p>The closest I got to is</p>

<pre><code>$(this).find('input[name="user[][username]"]').each(function() {
</code></pre>

<p>But for it to work I need to explicitly write the number on the first [], eg:</p>

<pre><code>$(this).find('input[name="user[1][username]"]').each(function() {
</code></pre>

<p>Is there a way to select ALL of them? I tried putting * and * between the [] but it didn't work.</p>

<p>Thanks for your help!</p>
