复制代码 代码如下:
//使页面不可编辑
function disableOcx() {
var form = document.forms[0];
for ( var i = 0; i < form.length; i++) {
var element = form.elements[i];
//部分元素可以编号 element.name 是元素自定义 name
if (element.name != "auditEntity.auditContent"
&& element.name != "auditEntity.auditAutograph"
&& element.name != "auditEntity.auditTime"
&& element.name != "auditEntity.auditState"
&& element.name != "submitBtn"
&& element.name != "reset"
&& element.name != "id"
&& element.name != "processInstanceId"
&& element.name != "updateForm") {
element.disabled = "true";
}
}
}
window.onload = disableOcx;//当页面加载的时候执行此函数
//取消不可编辑
function noDisable() {
var form = document.forms[0];
for ( var i = 0; i < form.length; i++) {
var element = form.elements[i];
element.disabled = false;
}
}
//使页面不可编辑
function disableOcx() {
var form = document.forms[0];
for ( var i = 0; i < form.length; i++) {
var element = form.elements[i];
//部分元素可以编号 element.name 是元素自定义 name
if (element.name != "auditEntity.auditContent"
&& element.name != "auditEntity.auditAutograph"
&& element.name != "auditEntity.auditTime"
&& element.name != "auditEntity.auditState"
&& element.name != "submitBtn"
&& element.name != "reset"
&& element.name != "id"
&& element.name != "processInstanceId"
&& element.name != "updateForm") {
element.disabled = "true";
}
}
}
window.onload = disableOcx;//当页面加载的时候执行此函数
//取消不可编辑
function noDisable() {
var form = document.forms[0];
for ( var i = 0; i < form.length; i++) {
var element = form.elements[i];
element.disabled = false;
}
}
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com
暂无“js 使FORM表单的所有元素不可编辑的示例代码”评论...