If you kept a table of input text box components and their tags, you could loop over the table for getting and saving.
See my Wordle keyboard code at