Below JavaScript can be used to disable HTML Attributes during run time. (Eg: TextBox, Select Box, Check Box, Radio Button, Etc)
<script>
window.onload= function()
{
DisableEnableForm(document.frmwitness,true);
}
function DisableEnableForm(xForm,xHow){
objElems = xForm.elements;
for(i=0;i
{
var ck = objElems[i].type;
if(ck=="select-one" || ck=="text")
{
objElems[i].disabled = xHow;
}
}
}
</script>
Note: You can call above function as per requirement.
<script>
window.onload= function()
{
DisableEnableForm(document.frmwitness,true);
}
function DisableEnableForm(xForm,xHow){
objElems = xForm.elements;
for(i=0;i
{
var ck = objElems[i].type;
if(ck=="select-one" || ck=="text")
{
objElems[i].disabled = xHow;
}
}
}
</script>
Note: You can call above function as per requirement.
No comments:
Post a Comment