fetching form value in an array in jQuery
<p>i have this dynamically populated form fields.</p>

<pre><code>&lt;input type="text" name="quantity[]" placeholder="quantity"/&gt;
&lt;input type="text" name="quantity[]" placeholder="quantity"/&gt;
&lt;input type="text" name="quantity[]" placeholder="quantity"/&gt;
&lt;input type="text" name="quantity[]" placeholder="quantity"/&gt;
&lt;input type="text" name="quantity[]" placeholder="quantity"/&gt;
</code></pre>

<p>on jQuery's keyup i want to fetch all the value from <code>input[name="quantity[]"]</code> and perform some calculations like total quantity i.e something like</p>

<pre><code>(field1 quantity value) + (field2 quantity value) + (field3 quantity value) ... n
</code></pre>

<p>i tried fetching the value like this.</p>

<pre><code>$('input[name="quantity[]"]').keyup(function(){
    var val = $(this).val();
});
</code></pre>

<p>this only fetches the value of first element and ignores the rest of fields. how do i go with what i want?</p>

<p>thank you</p>
