How to loop through ALL controls of a form

Hopefully, someone else can confirm/deny that your approach of processing both arrays is required. You're right in that it seems less than optimal. How much of a problem that is depends on just how many elements are in play. The other thing I've done is to use JavaScript to iterate through elements that are rendered on the page (all the buttons for example), and update things that way, but not very convenient if you have a lot of different component types, and they don't end up with the same name on the page anyway, so your index isn't going to work there, unless you add the index as a class name or something, which seems redundant as compared to what you're doing now.