Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to set the state on .ready? #706

Open
StepIg opened this issue May 18, 2019 · 3 comments
Open

how to set the state on .ready? #706

StepIg opened this issue May 18, 2019 · 3 comments

Comments

@StepIg
Copy link

StepIg commented May 18, 2019

I need to set the state.
the checked value in html doesnt work
and also how to change the state after loading a page?
thanks in advance

@morrow95
Copy link

morrow95 commented Jun 3, 2019

I just noticed this as well when updating to 3.4 from 3.3.4. Even though I have 'checked' or 'unchecked' specified in the html for each input this new version doesn't respect them at all. This worked perfectly fine with version 3.3.4.

Do we have to manually set the check state in js for every input now? If so, that is a pretty dumb change.

@nitrique
Copy link

nitrique commented Jun 5, 2019

Hi,

Same here, it works on 3.3.5 but not on 3.4 branch using AngularJS.

@StepIg have you set the on or off text ? When I use default value on these fields, I don't have the bug, can you confirm ?

Nicolas

@avits1
Copy link

avits1 commented Aug 20, 2019

Hi, Is the problem fixed yet?
I still cannot create and show the switch in the ON state.

sample code:
let whatever_toggle = $(<input type="checkbox" name="whatever-toggle" class='whatever_toggle'></input>);
$(parent_elem).append(whatever_toggle);
// ....
$(".whatever_toggle").bootstrapSwitch({
state: true,
// size: null,
size: 'mini',
// animate: true,
onColor: 'primary',
offColor: 'danger'
// .....
});
i tried the defaults in: size, onColor , offColor but still remains [OFF] ..

btw, i'm using CDN links to BOOTSTRAP 4.3.1 and to jquery-3.4.1.min.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants