I am using JQ/JQM. In the code below, I get a list of userid's in the data.userids ajax result returns. That is working correctly because I get an expected list of 7,166 back. These userid's correspond to a checkbox(sendtext_userid or sendtext_7). I am trying to loop through the checkboxes and check the ones that have an id listed in the returned result set.
I just cannot get the it to loop through the array list... any ideas?
if(data.result=='success'){
$('#sendmessagefrm :checkbox').each(function(){
var cbid = $(this).attr("id");
var uids=$(data.userids).toArray();
$.each([uids],(function() {
var userid = 'sendtext_'+ $(this).val();
if(cbid=userid){
$('#'+ userid + 'input:checkbox').attr('checked', true);
}
// and the rest of your code
}));
Chris Scott
I just cannot get the it to loop through the array list... any ideas?
if(data.result=='success'){
$('#sendmessagefrm :checkbox').each(function(){
var cbid = $(this).attr("id");
var uids=$(data.userids).toArray();
$.each([uids],(function() {
var userid = 'sendtext_'+ $(this).val();
if(cbid=userid){
$('#'+ userid + 'input:checkbox').attr('checked', true);
}
// and the rest of your code
}));
Chris Scott