I've run into a bit of a problem concerning JavaScript and ASP.NET.
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:
[code=JavaScript]
function DisableAllInput s()
{ var i;
var allInputElement s=document.getE lementsByTagNam e('input');
var len=allInputEle ments.length;
for(i = 0; i < len; i++)
{
var temp = allInputElement s[i];
if(temp.type==" text")
{ temp.disabled=t rue;
}
}
var allDropDownList s=document.getE lementsByTagNam e('select');
var lenOfDDLs=allDr opDownLists.len gth;
for(i = 0; i < lenOfDDLs; i++)
{ var temp = allDropDownList s[i];
temp.disabled=t rue;
}
}[/code]
Does anyone have an idea of why the values of the TextBoxes and DropDownLists are nothing when the page is posted back to the server and JavaScript has been used disabled these controls?
-Frinny
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:
[code=JavaScript]
function DisableAllInput s()
{ var i;
var allInputElement s=document.getE lementsByTagNam e('input');
var len=allInputEle ments.length;
for(i = 0; i < len; i++)
{
var temp = allInputElement s[i];
if(temp.type==" text")
{ temp.disabled=t rue;
}
}
var allDropDownList s=document.getE lementsByTagNam e('select');
var lenOfDDLs=allDr opDownLists.len gth;
for(i = 0; i < lenOfDDLs; i++)
{ var temp = allDropDownList s[i];
temp.disabled=t rue;
}
}[/code]
Does anyone have an idea of why the values of the TextBoxes and DropDownLists are nothing when the page is posted back to the server and JavaScript has been used disabled these controls?
-Frinny
Comment