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

checking checked state of check box gives flipped result #426

Closed
kapyaar opened this issue Nov 29, 2020 · 1 comment
Closed

checking checked state of check box gives flipped result #426

kapyaar opened this issue Nov 29, 2020 · 1 comment

Comments

@kapyaar
Copy link

kapyaar commented Nov 29, 2020

When I use "IfClicked" to find the current state of a checkbox, the result is flipped. ie, shows unchecked when it is checked, and vice versa,

Just to show what I am talking about, I downloaded the latest git version, and put it on my domain. Here is the link.

http://watchdog15.com/icheck-103/demo/index.html

Scroll down to flat skin section. I have the first two check boxes display their checked state right next to them. One is unchecked and the other is checked by default, to show that it does not seem to make any difference. The result seems to show the opposite of the real state.

jquery code is around line#1165 if you want to see that from the source.

                       $('input[name="enableTest"]').on('ifClicked', function(event){ 
				//console.log(this.prop('checked'));
				if($(this).prop('checked')){
					$('#chkbx1State').html("checked");
					 console.log('checked');
				  }else{
					$('#chkbx1State').html("Not checked");
					 console.log('not checked');
				  }				
			  });

Is there an "icheck" way to check this? I searched a lot, and saw few other mentions similar to this, but could not quite figure it out. Thanks for any hints.

@kapyaar
Copy link
Author

kapyaar commented Nov 30, 2020

Alright, I think I got a working solution. Instead of ifClicked, IfChecked seems to give correct response. Still curious as to why ifClicked gives flipped prop readings. I will keep this open for a short bit in case someone may see this and enlighten, otherwise I will close this issue.

@kapyaar kapyaar closed this as completed Dec 1, 2020
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

1 participant