I am trying to make an jQuery function to make sum of some input fields with array name, but not same id.
<input name="ingredient[1]" type="text" id="autofield_1" class="ingrediente">
<input name="ingredient[2]" type="text" id="autofield_2" class="ingrediente">
<input name="ingredient[3]" type="text" id="autofield_3" class="ingrediente">
<input name="ingredient[4]" type="text" id="autofield_4" class="ingrediente">
<input name="ingredient[5]" type="text" id="autofield_5" class="ingrediente">
<input name="ingredient[6]" type="text" id="autofield_6" class="ingrediente">
Note: I use a button with jQuery function to add new field on press, is using appendTo to add more fields. sometimes I have more or less fields, the jQuery function must be dynamic, to apply on the number of input fields set.
inputs?$( '.ingrediente' )or name starts condition.