The method for recursive disabling and re-enabling of all the input elements on the page can be found in my article
Modal Popup From Scratch.
Download the source code, locate the file "ModalPopup.js" and the function
disableAll
. First argument of this function is the list where all the disabled elements are gathered, later on, you can re-enable them. Second argument is the HTML element which should be skipped from disabling, with all its children, third argument is the parent element of all the controls to be disabled.
—SA