Check if form has been submitted
Add metric id to input names
Add foreach loop for $page['metrics']