Script to check values in list or checkbox field

Script to check values in list or checkbox field

How do you loop through the vales in a listbox or checkbox and take some action if a user's input matches?

For example, a user inputs his Age = 41, then have an On User Input check all vales in a list field Agedata (11, 14, 21, 40, 41).

Do i need to use string functions to step through each value in the Agedata listbox (or checkbox)?