当前位置: 代码迷 >> HTML/CSS >> DHTML checkbox 取舍的几种应用方法
  详细解决方案

DHTML checkbox 取舍的几种应用方法

热度:880   发布时间:2012-11-22 00:16:41.0
DHTML checkbox 选择的几种应用方法
js 代码
?
  1. //==================================================================================????
  2. //?Copyright?(c)?1998-2007?by?www.bizservice.com.cn,?All?rights?reserved.????
  3. //?Email:contact@bizservice.com.cn,?HangZhou,?China????
  4. //????
  5. //?This?software?is?the?confidential?and?proprietary?information?of????
  6. //?Bizservice.Com.Cn.?("Confidential?Information").?You?shall?not?disclose????
  7. //?such?Confidential?Information?and?shall?use?it?only?in?accordance????
  8. //?with?the?terms?of?the?license?agreement?you?entered?into?with?Bizservice.Com.Cn.????
  9. //==================================================================================????
  10. //?Author:?Wilson?Lin????
  11. //?Date:?2004-6-15?14:19:50????
  12. //?Description:????????
  13. //?????无????
  14. //?Function?List:?????????
  15. //?????1.?无????
  16. //?History:????
  17. //?????1.?无????
  18. //==================================================================================????
  19. ????
  20. //?全选????
  21. function?checkAll(form)?{????
  22. ????for?(var?i=0;?i
  23. ???????var?e?=?form.elements[i];????
  24. ???????if?(e.type=="checkbox")????
  25. ???????????e.checked?=?true?;????
  26. ????}????
  27. }????
  28. ????
  29. //?全不选????
  30. function?checkNotAll(form)?{????
  31. ????for?(var?i=0;?i
  32. ???????var?e?=?form.elements[i];????
  33. ???????if?(e.type=="checkbox")????
  34. ???????????e.checked?=?false?;????
  35. ????}????
  36. }????
  37. ????
  38. //?是否有选中的项????
  39. function?isChecked(form){????
  40. ????for?(var?i=0;?i
  41. ???????var?e?=?form.elements[i];????
  42. ???????if?(e.type=="checkbox"){????
  43. ???????????if(e.checked){????
  44. ??????????????return?true;????
  45. ???????????}????
  46. ???????}????
  47. ????}????
  48. ????return?false;????
  49. }????
1 楼 i_love_sc 2007-10-26  
就这几行破代码还加个版权,哎。
2 楼 congpeixue 2008-04-17  
function doFlgCheckedCheck() {
if (document.mainForm.checkFlgArray != undefined) {
var len = document.mainForm.checkFlgArray.length;
var checkedCnt = 0;
if (len > 1){
for (var i = 0; i < len; i++){
if (document.mainForm.checkFlg[i].checked == true){
checkedCnt++;
}
if (checkedCnt < 1){
document.mainForm.document.mainForm.checkFlg[0].checked = true;
showAlert(SY001MCE0038);
return false;
}
}
} else {
if (document.mainForm.checkFlg.checked == true){
checkedCnt++;
}
if (checkedCnt < 1){
document.mainForm.document.mainForm.checkFlg.checked = true;
showAlert(SY001MCE0038);
return false;
}
}
}
return true;
}
3 楼 melin 2008-04-17  
i_love_sc 写道
就这几行破代码还加个版权,哎。

  相关解决方案