GoldSoft Posted August 15, 2014 Share Posted August 15, 2014 i have this code for multi check-box <fieldset data-role="collapsible"><legend>Pick one</legend><div data-role="controlgroup" id="ZIBI" align="right" ></div></fieldset>myArray1 = new Array("1","2","3","4","5","6");$("#ZIBI").html('');for (var i = 0; i < myArray1.length; i++) {row = myArray1[i];$("#ZIBI").append('<label for=' + row + '>' + row + '</label>' +'<input type="checkbox" name="favcolor" id=' + row + ' value=' + row + '>');}$('#ZIBI').trigger('create'); how to check all or uncheck all by pressing any button ? thanks Link to comment Share on other sites More sharing options...
niche Posted August 15, 2014 Share Posted August 15, 2014 Why not use javascript? Link to comment Share on other sites More sharing options...
thescientist Posted August 15, 2014 Share Posted August 15, 2014 Why not use javascript? he is. I think this post is in the wrong forum. I will move it. Link to comment Share on other sites More sharing options...
JamesB Posted August 15, 2014 Share Posted August 15, 2014 (edited) http://stackoverflow.com/questions/426258/how-do-i-check-a-checkbox-with-jquery for (var i = 0; i < myArray1.length; i++) { var row = myArray1[i]; $("#"+row).prop('checked', true);} Edited August 15, 2014 by JamesB Link to comment Share on other sites More sharing options...
dsonesuk Posted August 15, 2014 Share Posted August 15, 2014 By specific name check $("input[name = 'option1']").attr("checked", true); uncheck $("input[name = 'option1']").attr("checked", false); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now