JS判断CHECKBOX是否选中

function checkboxdo(){
 var mobileCode="<%=custAddrEditID.getMobileCode()%>";
 var editmode="<%=custAddrEditID.getEditModeTxt()%>";
  if(document.getElementsByName("meKbnChk")[0].checked){   
   document.getElementsByName("deliveryName")[0].value="本人"   
   document.getElementsByName("deliveryAddressee")[0].readOnly=true;
    if(editmode=='insertMode'){
     document.getElementsByName("mobileCode")[0].value='<%=regCust.getMobileCode()%>';
    }else{
     document.getElementsByName("mobileCode")[0].value=mobileCode;
    } 
   document.getElementsByName("deliveryAddressee")[0].value='<%=userInfo2.getCustName()%>';  
   document.getElementsByName("meKbn")[0].value="1";
   document.getElementsByName('deliveryAddresseeDiv')[0].innerHTML = "";   
  }else{
   document.getElementsByName("deliveryName")[0].value="非本人"  
   document.getElementsByName("deliveryAddressee")[0].readOnly=false;
   //document.getElementById("deliveryAddressee").style.background='#ffffff';
   document.getElementsByName("deliveryAddressee")[0].value='<%=custAddrEditID.getDeliveryAddressee()%>';
   document.getElementsByName("mobileCode")[0].value='<%=custAddrEditID.getMobileCode()%>';
   //document.getElementById("deliveryName").value=""
   document.getElementsByName("meKbn")[0].value="0"; 
    
  }

你可能感兴趣的:(checkbox)