Metodo per abilitare oggetti definiti in una pagina HTML-XHTML. Nel caso specifico vengono abilitate tutte le caselle di testo, le Aree di testo, i radio button, le checkbox e le caselle di scelta rapida del primo form presente nella pagina.
function enableControls(){
var mytype = "";
for (var x = 0; x < document.forms[0].elements.length; x++){
mytype = document.forms[0].elements[x].type;
if (mytype == 'text' || mytype == 'textarea' || mytype == 'radio' || mytype == 'checkbox')
{
document.forms[0].elements[x].disabled=false;
document.forms[0].elements[x].style.backgroundColor = "#ffffff";
}
if (mytype == 'select-one' || mytype == 'select-multiple'){
document.forms[0].elements[x].disabled=false;
document.forms[0].elements[x].style.backgroundColor = "#ffffff";
}
}
}