//radio
$("#menuTable_2").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;
});

//checkbox
$("#menuTable_2").find("input[type='checkbox']").click( function(){

this.checked = !this.checked;
});

//textarea
$("#menuTable_2").find("input,textarea")
.attr("readOnly",'true').css("background-color","#EEE")
.each(function(){
this.onclick = undefined;
})

//select
$("#menuTable_2").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;});
})

//text
 $("#dep_no,#dep_name").attr("readOnly",'true').css("background-color","#EEE")


//HTML
<input type=text size=15 name=dep_name id=dep_name value="<%=rs.getString("dep_name")%>" readonly style="background-color:#EEE">

 

文章標籤
全站熱搜
創作者介紹
創作者 penguin1989930 的頭像
penguin1989930

Mark Chou的部落格

penguin1989930 發表在 痞客邦 留言(0) 人氣(458)