Hi!
If you want to avoid duplicating any code you will have to set the current elements. Currently, it looks like your variables only get set once, and then you are not updating them based on which one input is actually being used. You could do this by using the onFocus() event on the text input and then setting your inputs to the appropriate information.
So basically it would look something like this:
export function age1_focus(event) {
currentDropdown = //your age dropdown element here
currentInputBox = //your age inputBox element here
}
And then the same for the other elements and the breed input.
Hope this helps!