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 do I grab the checked value on init? #223

Open
cmcguff-myob opened this issue Mar 18, 2020 · 2 comments
Open

How do I grab the checked value on init? #223

cmcguff-myob opened this issue Mar 18, 2020 · 2 comments

Comments

@cmcguff-myob
Copy link

I have some code on changing the checkbox that toggles some UI on/off, that piece is working fine per this code

$('input[name="leave_type[validate_balance]"]').change(function() {
	$('#threshold_options').toggle($(this).prop('checked'));
});

If I try and grab the value on init, it is always false, no matter what's been saved, how do I get the state of the checkbox on first load? Everything else works perfectly.

$('input[name="leave_type[validate_balance]"]').init(function() {
    // Always false
    alert($('input[name="leave_type[validate_balance]"]').prop('checked'));
});
@ipr0dex
Copy link

ipr0dex commented Oct 21, 2020

This plugin has not been supported for more than 6 years. What's the point of writing anything here?

@leoplct
Copy link

leoplct commented Nov 13, 2020

Are there other alternative? We are using this plugin a lot

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

3 participants