Skip to content
Loading
can we disable enable controls of specific div on checkbox  
  •       
  •   
  •  
  • +3
  • Rameez Javed
    Jignesh Kumar Thanks, I have done something like
    1. $('#chkbxOne').change(function () {  
    2.             var c = this.checked ? 'T' : 'F';  
    3.             if (c == "T") {  
    4.                 $("#divOne").removeClass("DisableOne");  
    5.                 //alert("Enable");  
    6.             }  
    7.             if (c == "F") {  
    8.                 $("#divOne").addClass("DisableOne");  
    9.                 //alert("Disable");  
    10.             }              
    11.         });  
    1. .disablePrimary {  
    2.             pointer-events: none;  
    3.             opacity: 0.4;  
    4.         }  
    anyhow, thanks everyone.
    +1
  • Rajanikant Hawaldar
    https://codepen.io/tipsoftheday/pen/JreAp https://www.tutorialrepublic.com/faq/how-to-disable-or-enable-a-form-element-using-jquery.php
    +1
  • Jignesh Kumar
    Hi Rameez,
     
    Please find below link which will help you.
     http://www.iminfo.in/post/how-to-disable-all-controls-of-particular-div-jquery
    1. $('#chkbxOne').change(function () {    
    2.             var c = this.checked ? 'T' : 'F';    
    3.             if (c == "T") {    
    4.               
    5.                $("#divName input,select,textarea,button").prop("disabled", false); 
    6.             }    
    7.             if (c == "F") {    
    8.                 $("#divName input,select,textarea,button").prop("disabled", true);    
    9.             }    
    10.               
    11.         });    
    +2