On Sun, Sep 19, 2010 at 12:06 AM, Wade Preston Shearer
<[email protected]> wrote:
> I believe that I have discovered a jQuery bug. Can anyone confirm that I'm
> not missing something?
>
> I have stopPropagation() set on checkbox click eventsd. While it is
> preventing the visual change of checkboxes being checked and unchecked, a
> test against the checked attribute of the field is returning true with each
> click.
This worked for detecting the click, but not stopping the check from showing up:
$('input:checkbox').click(function(e) {
e.stopPropagation();
if($(this).attr('checked') == true) {
console.log('thinks its checked');
} else {
console.log('not checked!!');
}
});
Adding a preventDefault(); calls stops the check from showing up, but
then the attr('checked') always returns true. If I were to take a
guess the act of preventing the default action means the checkbox
processing never hits the 'checked' attribute, so it is always in the
default state. In this case the default state would be unchecked, so
any click on it would mean it was being 'checked'.
--
Joseph Scott
[email protected]
http://josephscott.org/
_______________________________________________
UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net