/* SetReadOnlyForm 设置表单元素为只读 * 参数 FormIndex 表单编号 * by bluedoctor http://www.pwmis.cn */ function SetReadOnlyForm(FormIndex) { var objForm=document.forms [FormIndex]; var obj; var strTextBox="";
for(var i=0;i< objForm.length ;i++) { obj=objForm.elements[i]; switch(obj.type) { case "text": case "textarea": obj.readOnly =true; obj.className ="CssReadOnly "; break; case "select-one": strTextBox=""; obj.style.display="none"; obj.parentElement.insertAdjacentHTML("beforeEnd",strTextBox); break; case "button": obj.disabled =true; //obj.className ="CssReadOnly "; break; } } }