Topic: How to disable MDB checkbox?

waynefulcher pro asked 6 years ago


I need to be able to use either the standard checkbox or the library I had been using which is Pretty Checkbox.

I can override the css and make my own checkbox if I need to but I can't figure out how to allow user to click on it again, it seems MDB has taken over the click event.

What I have done so far is "not" put any of the class names in the MDB documentation and then override the following CSS:

input[type='checkbox'],
input[type='checkbox']:checked,
input[type='checkbox']:not(:checked)
{
    -webkit-appearance:none;
    width: 14px;
    height: 14px;
    background: #FFFFFF;
    border-radius: 5px;
    border: 1px solid #555;
    opacity: 1;
    z-index: 0;
    position: unset;

}
input[type='checkbox']:checked {
    background: #4285f4;
}

But again when I click on the actual checkbox my click event does not fire.
Thanks

nextstepmedia pro answered 6 years ago


To disable MDBootstrap styles and get native checkboxes:
input[type='checkbox'], input[type='checkbox']:checked, input[type='checkbox']:not(:checked) {
  display: inline-block;
  position: relative;
  pointer-events: auto;
  opacity: 1;
}

Piotr Glejzer staff answered 6 years ago


So do you want to overwirte our css, don't you? What excacly do you need? Only to allow user to click again to checkbox and change color?

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags