www.gusucode.com > 同城苏州黄页系统php源码程序 > mod.js/checkbox_act.js
function check_all(theform) { if(!theform) theform=document.form1 for(idx=0;idx<theform.length;idx++) { if(theform[idx].type!='checkbox') continue; theform[idx].checked=true; } } function uncheck_all(theform) { if(!theform) theform=document.form1 for(idx=0;idx<theform.length;idx++) { if(theform[idx].type!='checkbox') continue; theform[idx].checked=false; } } function reverse_checkbox(theform) { if(!theform) theform=document.form1 for(idx=0;idx<theform.length;idx++) { if(theform[idx].type!='checkbox') continue; if( theform[idx].checked ) theform[idx].checked=false; else theform[idx].checked=true; } } function get_checked_cnt(theform) { if(!theform) theform=document.form1 cnt = 0; for(idx=0;idx<theform.length;idx++) { if(theform[idx].type!='checkbox') continue; if( theform[idx].checked ) cnt ++; } return cnt; }