Not applicable to jQuery Mobile (missed OP comment on mobile), just standard jQuery.
Check checkbox 2 if checkbox 1 is unchecked and checkbox 2 is also unchecked
Otherwise, if box 1 is checked and box 2 is checked, box 2 is not checked
Flag 2 does not have the function of checking / unchecking flag 1.
Working example: http://jsfiddle.net/tuxzn/
works in chrome, FF, IE10
<ol> <li> <input name="check[1]" type="checkbox" checked="checked" value="1" /> </li> <li> <input name="check[2]" type="checkbox" value="1" /> </li> </ol>
Detailed method
(function($){ $(document).ready(function(){ $('input[name="check[1]"]').change(function(e){ if( $(this).is(':checked') ){ $('input[name="check[2]"]').prop('checked', false); }else{ $('input[name="check[2]"]').prop('checked', true); } }); }); })(jQuery);
Shorter method (with mobile phone) http://jsfiddle.net/Ag9Cn/
$('input[name="check[1]"]').change(function(e){ $('input[name="check[2]"]').prop('checked', !!!$(this).is(':checked')) .checkboxradio('refresh');
fyrye source share