How to forbid unchecking checkbox's element?

Is it possible to forbid some action on checkbox? For example I want to leave $('#post-id') and $('#activation') checkboxes always checked, without any possibilities to uncheck them?

$("#activation").attr("checked", true);
$("#post-id").attr("checked", true);

My example you can find here:


You can use like this

      $( '#common' ).on('click', function () {
        $( '.common-inputs [type="checkbox"]:not([disabled])' ).prop('checked', this.checked); 

            $("#activation").attr("checked", true);
      $("#post-id").attr("checked", true);
      $("#activation").attr("disabled", true);
      $("#post-id").attr("disabled", true);

You can simply add disabled to the checkboxes in question. They then have their default value, however, will not be editable anymore.

These are the changes in question:

<input type="checkbox" id="activation" name="check" disabled/>

This would be your updated jsfiddle:

Enjoy :)

You can use this code snippet after checked true.

function HideandDisabled(){
    $("#activation").attr("checked", true);
    $("#post-id").attr("checked", true);

Need Your Help

Google app engine for static files in joomla

php google-app-engine joomla

hi i want to use google app engine for the static data for my joomla website currently my site is i want to put all the css and js files in the app engine please help i am using g...