Upon page submission I disable all of my buttons and would also like to disable all of my inputs (Textboxes, DropDownLists, etc) as well. This will prevent multiple postbacks to the server while it's processing and keep the user from making changes during this time.
The problem is that when I use JavaScript to disable the input controls the values of these objects come back as nothing.
The JavaScript is quite simple:
Expand|Select|Wrap|Line Numbers
- function DisableAllInputs()
- { var i;
- var allInputElements=document.getElementsByTagName('input');
- var len=allInputElements.length;
- for(i = 0; i < len; i++)
- {
- var temp = allInputElements[i];
- if(temp.type=="text")
- { temp.disabled=true;
- }
- }
- var allDropDownLists=document.getElementsByTagName('select');
- var lenOfDDLs=allDropDownLists.length;
- for(i = 0; i < lenOfDDLs; i++)
- { var temp = allDropDownLists[i];
- temp.disabled=true;
- }
- }
-Frinny