标签:
function changeFormElementStatus(tagNames) {
var tagNameArr = tagNames.split(",");
for (var j = 0; j < tagNameArr.length; j++) {
var tagName = tagNameArr[j];
var tags = document.getElementsByTagName(tagName);
for (var i = 0; i < tags.length; i++) {
var tag = tags[i];
if (tag.disabled) {
if (tagName != "select") {
tag.disabled = false;
tag.readOnly = true;
if (tag.onclick != null && tag.onclick.toString().indexOf("WdatePicker") != -1) {
tag.onclick = "";
}
}
else {
//tag.disabled=false;
//tag.onfocus="this.defaultIndex=this.selectedIndex;";
//tag.onchange="this.selectedIndex=this.defaultIndex;";
}
}
}
}
}
</script>
<script src="../../Script/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
</head>
<body onload="changeFormElementStatus(‘input,select,textarea‘);">
标签:
原文地址:http://www.cnblogs.com/qishiguilai/p/3992184.html