How to add user data and then display

Can anyone help me to write script where we can add policy details, for eg. if we add 5 policy numbers while clicking add policy button but when we click on display button it should display all 5 policy numbers which are added, kindly refer below screenshot

image
image
image

What have you tried so far?