Skip to content
Loading
Default Value of CheckBox
+1
  • Rijwan Ansari
    Hi,
     
    You can do in this way
     
    1. "checkbox" name="chkcc9" id="myCheckbox">  
    2. lt;button onclick="enable_checkbox()">Add  
    js
    1. function enable_checkbox() {  
    2.  $('.myCheckbox').prop('checked'true);  
    3. $('.myCheckbox').attr("disabled"true);  
    4. }  
     You can do something like this.
    0
  • Arnab Mukherjee
    1. if(condition = true)  
    2. {  
    3. @Html.CheckBoxFor(x => x.IsVisible, new { @checked = "checked" })  
    4. }  
    5. else  
    6. {  
    7. @Html.CheckBoxFor(x => x.IsVisible)  
    8. }  
    0