i have this dynamically populated form fields.
<input type="text" name="quantity[]" placeholder="quantity"/>
<input type="text" name="quantity[]" placeholder="quantity"/>
<input type="text" name="quantity[]" placeholder="quantity"/>
<input type="text" name="quantity[]" placeholder="quantity"/>
<input type="text" name="quantity[]" placeholder="quantity"/>
on jQuery's keyup i want to fetch all the value from input[name="quantity[]"] and perform some calculations like total quantity i.e something like
(field1 quantity value) + (field2 quantity value) + (field3 quantity value) ... n
i tried fetching the value like this.
$('input[name="quantity[]"]').keyup(function(){
var val = $(this).val();
});
this only fetches the value of first element and ignores the rest of fields. how do i go with what i want?
thank you