DanielRivers / jQuery-Visibly

Plugin to easily show elements based on values of other elements
MIT License
25 stars 10 forks source link

Do checkboxes work? #4

Open jasondavis opened 7 years ago

jasondavis commented 7 years ago

Do checkboxes work?

I tried this:

<input id="foo" name="foo" type="checkbox"> Foo
<input id="foo2" name="foo2" type="checkbox"> Foo2
<input id="foo3" name="foo3" type="checkbox"> Foo3

<div id="test" class="conditional" visibly="foo:checked%foo3:checked">

with:

$('#test').Visibly();

When ran it hides my #test DIV but will not show it when checkboxes are checked

christianmagill commented 7 years ago

I'm having trouble with checkboxes as well. It seems like the issue is related to val() being used as it returns the value for the field regardless of whether it is checked or not.