In JQM (or just JQuery really) don't forget the
prop()
method for properties as opposed to attributes
attr()
This is a check box solution when one or both but not none must be selected:-
The integer i is passed from each checkbox in an onclick, to save a DOM lookup.
function checkNoti(i) {
if ((!$('#notiEmail').prop('checked'))&&(!$('#notiSMS').prop('checked'))) {
debug('ss');
if (i==1) $('#notiSMS').prop('checked','true').checkboxradio("refresh"); else $('#notiEmail').prop('checked','true').checkboxradio("refresh");
}
}