Check checkbox status - bootstrap switch

Asked

Viewed 282 times

2

I’m using bootstrap-switch in my checkboxes and I would like to check the status of my checkbox loading the page using the library itself.

1 answer

2


Just use .bootstrapSwitch('state'), it will return the status of your checkbox. It follows the events library :)

To get the status after loading the page, you can use the code below:

//evento executado após a pagina ser carregada..
$(document).ready(function() {
    //método para busca do estado
    var state = $("#seuCheckbox").bootstrapSwitch('state');
});

Follows the fiddle :)

  • Thanks man, I hadn’t thought to do that. To breaking my head has 2 days. kkk Thank you very much :D

  • Glad it worked out, I’m in the mood :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.