关于网页多选框的代码问题,我勾选了多选框之后,它就变成灰色,不能再次操作的,请问这样的效果如何实现
js\u4ee3\u7801\u91cc \u591a\u9009\u6846 \u5982\u4f55\u5199\u6210\u9009\u4e2d\u72b6\u6001\uff1f\u83b7\u53d6\u5230checkbox\u5143\u7d20\u540e\uff0c\u8bbe\u7f6e\u5176checked\u5c5e\u6027\u4e3atrue\u6216false\u6765\u6539\u53d8\u5176\u9009\u4e2d\u72b6\u6001\u3002
function check()
{
//\u6839\u636eID\u83b7\u53d6checkbox\u5143\u7d20 \u8bbe\u7f6e\u5176checked\u5c5e\u6027\u4e3atrue \u9009\u4e2d
document.getElementById("myCheck").checked=true;
}
function uncheck()
{
//\u6839\u636eID\u83b7\u53d6checkbox\u5143\u7d20 \u8bbe\u7f6e\u5176checked\u5c5e\u6027\u4e3afalse \u53d6\u6d88\u9009\u4e2d
document.getElementById("myCheck").checked=false
}
\u8fd8\u9700\u8981\u8bbe\u7f6echeckbox\u88ab\u9009\u4e2d\u540e\u7684\u72b6\u6001\uff0cinput[type=checkbox]:checked:after{},\u7528\u56fe\u7247\u8868\u793a\u9009\u4e2d
<input type="checkbox" onclick="disableThis(this)"/><script>
function disableThis(cbx){
cbx.disabled = "disabled";
}
</script>
绛旓細function disableThis(cbx){ cbx.disabled = "disabled";}
绛旓細棣栧厛瑙i噴涓媔nster杩欎釜鍑芥暟锛屼綘杩欎箞鍐欐槸妫鏌ヨ繖涓瓧绗︿覆鏄惁鍖呭惈浣犱粠鏁版嵁搴撹鍙栫殑杩欎釜绐滐紝濡傛灉鍖呭惈杩斿洖1锛屽洜涓120锛屽寘鍚12锛屾墍浠ュ綋浣犲彧鏈120鐨勬椂鍊欑粨鏋滄槸瀵圭殑锛屼竴鏃︽湁浜12锛屽嵆浣夸綘12涓嶆槸鎵鍕椤癸紝浠栦篃浼氭墦涓婂嬀鐨勫洜涓哄鏋滄湁120鐨勮瘽锛屼粬鑲畾鍖呭惈12銆2妤肩殑鍥炵瓟涓嶅彲浠ュ彇鍟婏紝姣忎釜瀛楃涓蹭笉涓瀹氭尐鐫鐨勶紝鎵浠ヤ綘杩...
绛旓細 ?
绛旓細//姣斿浣犵殑澶氶夋鏄1 If Form1.CheckBox1.Value = 1 Then //杩欓噷鍐鍕閫鐨勪唬鐮 Else // 杩欓噷鍐欎笉鍕鹃夌殑浠g爜 End If
绛旓細1锛氬彧鍕閫変竴涓槸鎸堿閿竴娆★紝杩樻槸寰幆鎸堿閿 2锛氬嬀閫1鍙2鍙3绛...杩囩▼涓紝鏄粠寰幆鎸堿閿紝鑷姩鏀逛负寰幆鎸堿閿瓸閿(ABC,ABCD...)锛岃繕鏄綋浣犲嬀閫夊悗寰幆瀵瑰簲鎸夐敭銆傜粰浣犲厛鍐欎釜鍙傝冨惂銆傘傘侱o If form1.CheckBox1.Value = 1 Then KeyPress "A", 1 End If If form1.CheckBox2...
绛旓細浠 Form1.CheckBox1.Value = 1 鍒ゆ柇锛屽彧瑕佷慨鏀笴heckBox1鍚嶅瓧灏卞彲浠ュ垽鏂悇涓妗嗙殑0鍜1鐘跺喌锛岀劧鍚庢牴鎹繖涓姸鍐靛垽鏂悇涓浘鐗囥傛瘮濡傦細if Form1.CheckBox1.Value = 1 Msgbox "绗竴涓妗嗗嬀閫変簡锛"End If //娌″嬀閫夐偅涓兼槸0
绛旓細鎴戞潵璧剁揣鍥炵瓟鍚э細浣犲彲浠ヨ繖鏍峰垽鏂晩 instr(",120,",",12,") > 0 杩欎箞鍒ゆ柇鍟娿備娇鐢ㄤ竴涓畾鐣岀鍚 鎹㈡垚浣犱笂闈鐨 浠g爜锛鏇挎崲濡備笅锛<%if instr(Trim(","&Size&","),Trim(","&rs("Size")&","))>0 then%>checked<%end if%>
绛旓細
绛旓細//鎶婄偣鍑讳簨浠跺幓鎺,灏辩暀涓嬮潰杩欎釜灏卞彲浠ヤ簡 If Form1.CheckBox1.Value = 1 Then //濡傛灉 澶氶夋琚鍕閫 鍒 璋冪敤 璋冩暣绐楀彛 瀛愮▼搴忔垨鍑芥暟 Call 璋冩暣绐楀彛 End If
绛旓細浣犲ソ锛浠g爜绀轰緥锛歱rivate void button1_Click(object sender, EventArgs e){ for (int i = 0; i < dataGridView1.Rows.Count; i++){ try { DataGridViewCheckBoxCell check = dataGridView1.Rows[i].Cells[0] as DataGridViewCheckBoxCell;//杩欒竟鏄寚绗0鍒楁槸checkbox,濡傛灉鏄叾浠栧垪鑷繁鐪嬬潃鏀 ...