12-18-2012 01:24 PM
I've made a JQMobile checkbox like so...
<label><input type="checkbox" name="checkbox" id="checkbox"/> Label</label>
I want to use Javascript to uncheck the box.
I've tried the script normally used for unchecking checkboxes with jquery
$('input[name=checkbox]').attr('checked', false);
I've also tried using a piece of code I found on the jQuery Mobile website ( http://jquerymobile.com/test/docs/forms/checkboxes
$("input[type='checkbox']").checkboxradio('disable ');
Neither methods seem to work.
Solved! Go to Solution.
12-18-2012 02:18 PM
You have to refresh every UI component in jQueryMobile if you change its state via JavaScript. In this case the code should look like this:
$("input[type='checkbox']").attr("checked",false). checkboxradio("refresh");
12-18-2012 02:40 PM
12-19-2012 12:20 PM