Verify checkbox state - bootstrap switch

2

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

    
asked by anonymous 09.09.2015 / 03:37

1 answer

2

If you use .bootstrapSwitch('state') , it will return the state of your checkbox. Here's the 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');
});

Follow the fiddle :)

    
09.09.2015 / 04:31