Problematically changing the switch


Topic: Problematically changing the switch

RF. Regalo asked 6 years ago

Hello,

I am trying to programmatically change the switch on and off. I have been trying to check / uncheck the underlying form element, and that hasn't worked, Do you have any suggestions?


Krzysztof Wilk staff answered 6 years ago

Hello!

The state of switch (on/off) depends on "checked" attribute of input. When input has this attribute, it's on, when input doesn't have it - it is off. So you have to use jquery to add/remove this attribute if you want to change it state.


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
  • User: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.8.0
  • Device: Desktop
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No