$("#formTab5,#formTab4,#formTab3,#formTab2,#formTab1").find("input,textarea")
.attr("readOnly",'true').css("background-color","#EEE")
.each(function(){
this.onclick = undefined;
})
$("#formTab5,#formTab4,#formTab3,#formTab2,#formTab1").find("input[type='checkbox']").click(
function(){
this.checked = !this.checked;
}
);
$("#formTab5,#formTab4,#formTab3,#formTab2,#formTab1").find("input[type='radio']").click(function () {
var el, e = 0, f = $(this).get(0).form;
while (el = f[$(this).attr("name")][e++]) el.checked = el.defaultChecked;
});
// select readonly
$("#formTab5,#formTab4,#formTab3,#formTab2,#formTab1").find("select").css("background-color","#EEE").each(
function(){
this.onchange = undefined;
$(this).bind("focus",function(){this.defaultIndex=this.selectedIndex;});
$(this).bind("change",function(){this.selectedIndex=this.defaultIndex;});
}
)
jquery 控制 select radio checkbox input 不可修改
最新推荐文章于 2021-06-16 17:14:01 发布