Dynamic number of inputs and varying id's

A kinda hacky way would be to already have all the input components hardcoded in your layout and to set their display to none. Then the dropdown function plays with the style to display or not the inputs you want, and your final function takes all the inputs into account, checks which ones are filled and generates your output.

Would love to hear simpler solutions