How do I disable a timepicker?


Topic: How do I disable a timepicker?

edwolfe pro asked 6 months ago

How do I disable a timepicker? I've tried putting a disabled attribute on it, but it appears to ignore it.


Tomek Makowski staff commented 6 months ago

Hi,

Try out this solution

https://mdbootstrap.com/snippets/jquery/tomekmakowski/2550520#html-tab-view

Regards


edwolfe pro answered 6 months ago

Ok. This solved it. I would like to request an enhancement so that the control could be told to be disabled or enabled. Something like $('.time-picker').timepicker('disabled', 'true') or similar. Makes for cleaner code (and less error prone) than having add disabled to 3 labels (or even need to add it to all children).


edwolfe pro answered 6 months ago

I have created a JQuery extended function to accomplish this task. It keeps your JavaScript clean with only one line needed to disable/enable a timepicker.

https://mdbootstrap.com/snippets/jquery/edwolfe/2559840


Please insert min. 20 characters.
Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: jQuery
  • MDB Version: 4.19.1
  • Device: ALL
  • Browser: All
  • OS: ALL
  • Provided sample code: No
  • Provided link: No