Calculate Age without storing DOB | XM Community
Skip to main content

Hi. I am in the midst of creating a survey for parents of infants. The survey is going to designed in such a way that depending on the exact age of child (i.e. months and days) they will be directed to answer different blocks. While we are ok to ask the question "How old is your child? ___months ____days", we would prefer for it to be an automatic calculation for the sake of accuracy.
But due to the nature of the research, we are not able to have a question asking for the child's date of birth (as it is an identifier and therefore it cannot be dumped out with the other data). Thus I was wondering if there is a way to use a custom code to have there be a form of age calculator, where the parents can put the child's DOB, and it would automatically calculate the age of the child, and have only that age be captured in the output (and disregard the date of birth they had entered).
Thank you!

In the descriptive text question, we need to create a input text using HTML, on click of next button calculate the age and store it in embedded data.


Thank you Rondev!


Leave a Reply