neilfurry Posted November 12, 2016 Share Posted November 12, 2016 Hello, Im hoping to get help from here, i have arrays of text fields that i need to get sums,.. <div class='fldgroup'> <input type="text" name="fld[0]"> <input type="text" name="fld[0]"> <input type="text" name="fld[0]"> <input type="text" name="sumfld[0]"> <button>Add Another Field</button> <input type="text" name="fld[1]"> <input type="text" name="fld[1]"> <input type="text" name="fld[1]"> <input type="text" name="sumfld[1]"> <button>Add Another Field</button> </div> <button>Add Another Group</button> how can i get the sum of all fld[0] and put it to sumfld[0] same as the fld[1] to sumfld[1],.. every text field is dynamically added using clone., i hope somebody can help me with this.... Thank you in advance... Quote Link to comment https://forums.phpfreaks.com/topic/302522-sum-of-arrays-within-arrays-using-jquery-and-javascript/ Share on other sites More sharing options...
neilfurry Posted November 13, 2016 Author Share Posted November 13, 2016 im wrong with the group structure. here is the correct grouping of array. <div class='fldgroup'> <input type="text" name="fld[0]"> <input type="text" name="fld[0]"> <input type="text" name="fld[0]"> <input type="text" name="sumfld[0]"> <button>Add Another Field</button> </div> <div class='fldgroup'> <input type="text" name="fld[1]"> <input type="text" name="fld[1]"> <input type="text" name="fld[1]"> <input type="text" name="sumfld[1]"> <button>Add Another Field</button> </div> <button>Add Another Field Group</button> Quote Link to comment https://forums.phpfreaks.com/topic/302522-sum-of-arrays-within-arrays-using-jquery-and-javascript/#findComment-1539272 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.