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

Checkbox change event not firing on unselect #1328

Closed
garyns opened this Issue Apr 1, 2011 · 10 comments

Comments

Projects
None yet
7 participants
@garyns

garyns commented Apr 1, 2011

I have noticed that checkboxes are only firing a change event when selected (ticked) and not when unselected.

For the below the change alert "Changed" is only shown when the checkbox is pressed to select.

<script>
  $(function() {
    $("#myCheckBox").change(function() {
      alert("Changed"); 
    });
  });
</script>


<div data-role="page" id="MyPage">
  <div data-role="content">
    <input type="checkbox" id="myCheckBox" name="myCheckBox">
    <label for="myCheckBox">Test</label>
   </div>
</div>
@toddparker

This comment has been minimized.

Show comment
Hide comment
@toddparker

toddparker Apr 1, 2011

Contributor

Just posted your code into a JSBin to test it and it seems to fire the alert on both scenarios on Chrome. Is this happening only on a specific device?
http://jsbin.com/eruku4/edit

Contributor

toddparker commented Apr 1, 2011

Just posted your code into a JSBin to test it and it seems to fire the alert on both scenarios on Chrome. Is this happening only on a specific device?
http://jsbin.com/eruku4/edit

@jamiemnewman

This comment has been minimized.

Show comment
Hide comment
@jamiemnewman

jamiemnewman Apr 1, 2011

Seems to be only with A4. Works fine with A3.

jamiemnewman commented Apr 1, 2011

Seems to be only with A4. Works fine with A3.

@garyns

This comment has been minimized.

Show comment
Hide comment
@garyns

garyns Apr 1, 2011

I get the problem with the current repository code on iPad and chrome.

garyns commented Apr 1, 2011

I get the problem with the current repository code on iPad and chrome.

@cmsfruit

This comment has been minimized.

Show comment
Hide comment
@cmsfruit

cmsfruit Apr 5, 2011

I'm also experiencing this issue with JQM a4 on iPhone simulator. Here is what my checkbox element looks like

<input type="checkbox" name="my_checkbox" onchange="javascript: doSomething();" />

it never fires the custom onchange event.

cmsfruit commented Apr 5, 2011

I'm also experiencing this issue with JQM a4 on iPhone simulator. Here is what my checkbox element looks like

<input type="checkbox" name="my_checkbox" onchange="javascript: doSomething();" />

it never fires the custom onchange event.

@dimio5

This comment has been minimized.

Show comment
Hide comment
@dimio5

dimio5 Apr 5, 2011

I think the source of the problem is commented here:

6121920

I hope it helps.

dimio5 commented Apr 5, 2011

I think the source of the problem is commented here:

6121920

I hope it helps.

@johnbender

This comment has been minimized.

Show comment
Hide comment
@johnbender

johnbender Apr 6, 2011

Contributor

fixed scoping issue that was causing the checkbox check to fail, tests to follow Closed by 141127b

Contributor

johnbender commented Apr 6, 2011

fixed scoping issue that was causing the checkbox check to fail, tests to follow Closed by 141127b

@johnbender johnbender closed this Apr 6, 2011

@vikaskanani

This comment has been minimized.

Show comment
Hide comment
@vikaskanani

vikaskanani Apr 7, 2011

@johnbender Your fix did not worked

vikaskanani commented Apr 7, 2011

@johnbender Your fix did not worked

@garyns

This comment has been minimized.

Show comment
Hide comment
@garyns

garyns Apr 7, 2011

I can confirm that the fix works in the current repository code.

garyns commented Apr 7, 2011

I can confirm that the fix works in the current repository code.

@johnbender

This comment has been minimized.

Show comment
Hide comment
@johnbender

johnbender Apr 10, 2011

Contributor

vikaskanani,

Can you post some more information so I can take a look?

Contributor

johnbender commented Apr 10, 2011

vikaskanani,

Can you post some more information so I can take a look?

@vikaskanani

This comment has been minimized.

Show comment
Hide comment
@vikaskanani

vikaskanani Apr 11, 2011

Oh, sorry I should have replied soon, any way that worked correctly. I was missing one statement,

Nice work thanks again.

vikaskanani commented Apr 11, 2011

Oh, sorry I should have replied soon, any way that worked correctly. I was missing one statement,

Nice work thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment