multiple datapickers

multiple datapickers

I have a questionnaire that collects birth dates of several people. How can I make these datefields working with one function to instantiate them all? I tried to use a class selector, but then only the first date field is accepting input