nickalchemist
nickalchemist

Reputation: 2241

Bootstrap switch change event not firing when state is changed from 'false' to 'true' dynamically

I am using Bootstrap Switch in my project to show a warning flag. Each time I try to set value of switch from false to true dynamically it is not going in .bootstrapSwitch().on method. It is working fine on changing switch state from false to true dynamically. Fiddle below-

http://jsfiddle.net/aanurn0j/

Upvotes: 0

Views: 4938

Answers (1)

ankur140290
ankur140290

Reputation: 640

Set third parameter to false and it works.

$('#toggleSwitchOn').click(function () {
    $('#bootstrapswitch').bootstrapSwitch('state', true, false);
});

jsFiddle

Upvotes: 3

Related Questions