Search Results for 'CheckBox'


1 POSTS

  1. 2008.11.03 checkbox 전체 선택

checkbox 전체 선택

Posted 2008. 11. 3. 20:09 by maxmini MAXMINI

<script type="text/JavaScript">
<!--
 var chk = document.votsubj.chk;
 var YN = document.votsubj.YN;

 if (document.all.checkboxAll.checked == true) {
  if(chk.length>1){
   for (var i=0; i<chk.length;i++) {
    if (chk[i].type == "checkbox" && chk[i].checked == false && chk[i].value.length > 0) {
     chk[i].checked = true;
     if(YN[i].value!="T"){
      YN[i].value = "Y";
     }
    }
   }
  }else{
   if(chk.checked == false){
    chk.checked = true;
    if(YN.value!="T"){
     YN.value = "Y";
    }
   }
  }
 }else {
  if(chk.length>1){
   for (var i=0; i<chk.length;i++) {
    if (chk[i].type == "checkbox" && chk[i].checked == true) {
     chk[i].checked = false;
     if(YN[i].value!="T"){
      YN[i].value = "N";
     }
    }
   }
  }else{
   if(chk.checked == true){
    chk.checked = false;
    if(YN.value!="T"){
     YN.value = "N";
    }
   }
  }
 }
}

//-->
</script>

<input type="checkbox" name="checkboxAll" onclick="javascript:checkAll();">


<input type="checkbox" name="chk"/>
<input type="hidden" name="YN" value="<%if("완료".equals(hm.get("PUSH_YN"))){%>T<%}%>">

Tag : ,

Write your message and submit