Maintain id/name of original element

Maintain the id and name of the original element in the new element created to store the selected values. This makes it easier to retrieve the values server side.

I had to create a new PR as I couldn't find a way to edit the previous one, sorry about that.