Wow thanks so much for your time. My coursework requires me to let users select some food items (e.g. by displaying a checkbox next to each food item and letting the user input the amount of each food item in the recipe e.g. 2x100 g flour) and calculating the sum of nutritional information. Currently if I just send using POST, my code returns the amount for all food items in my table instead of just the ones that have the checkbox checked which is the reason for trying to use the javascript function to create a new array of the amount values that have their checkbox checked.