I would probably write several variants of input for common cases, such as a function that get's input as a string(as you have now), a function that gets input as a number(this function would validate integer data), and an input that take's an input as an integer, and checks that value between a min/max values.
you can also use variable args/arrays to create lists of strings, or numbers for validation.
but yes, function that stuff big time!