title: How to get a collection of input elements by name attribute
body: <p>I've got a form which looks like that:</p>
  
  <pre><code>&lt;form method="post" enctype="multipart/form-data" onsubmit="return new_post_form_submit();"&gt;    
  &lt;input type="hidden" name="task" value="addPost"&gt;   
  &lt;input type="hidden" name="post_photo_edit[]" value="0"&gt;    
  &lt;input type="hidden" name="post_photo_edit[]" value="0"&gt;
  &lt;input type="hidden" name="post_photo_edit[]" value="0"&gt;
   ... 
  &lt;/form&gt;
  </code></pre>
  
  <p>Inside <code>new_post_form_submit</code> function, I would like to select all the elements named <code>post_photo_edit</code> as a collection. As You can see it name actually is <code>post_photo_edit[]</code>, because I want to have it as an array inside my PHP code.</p>
  
  <p>I'm using MooTools, but probably jQuery will have exactly the same solution for this.</p>
  
  <p>I've tried to call </p>
  
  <pre><code>$$("input[name='post_photo_edit[]']")
  </code></pre>
  
  <p>but it gave me an exception. And calling it this way:</p>
  
  <pre><code>$$("input[name='post_photo_edit']")
  </code></pre>
  
  <p>returns empty collection.</p>
  
  <p>I know I can call this instead</p>
  
  <pre><code>document.getElementsByName("post_photo_edit[]")
  </code></pre>
  
  <p>and it will work perfect, but I'm wondering how this expression should look like in MooTools to work like this above.</p>
  
  <p>any ideas?</p>