Changing state of component switches

2 replies · opened Jan 10, 2017

JjuanchpJan 10, 2017

Good morning,
I am working with this feature, but I need to change the state of the component switch by code. Is this possible? I am using the default one.


	Default:

	

I have a jquery function to make changes in the code by "id" with the tag checked "true" or "false" like this:
$("#ok1").prop("checked", false);

But is not working.
What can I change the state?

Thank you very much
Juan Carlos

SSemicolon WebSTAFFJan 12, 2017

Hello,

Consider using the following JS Code:

jQuery('#ok1').bootstrapSwitch('state', false);

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

JjuanchpJan 12, 2017

Solved!

Thank you sooooo much!!

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard