恢复复选框列表

时间:2013-01-28 17:32:44

标签: jquery-mobile checkbox

我正在尝试使用jquery mobile,我想检索复选框的列表。这是我填写复选框列表的代码:

for( var i=0; i<results.rows.length; i++  ) //Remplir tableau liste des identifiants étapes
    { 
         $('#lbtn2').append("<input    type='checkbox' value="+
               results.rows.item(i).Phrase+
               "  name = "+results.rows.item(i).QuotationParDefaut+
               "   id="+results.rows.item(i).idPhrase+" />");
         $('#lbtn2').append('<label for='+
               results.rows.item(i).idPhrase+'>'+
               results.rows.item(i).Phrase+'</label>');
    }

以下是允许检索所选标签列表的代码。

$("#lbtn2 input:checked").each(function()
{
   tab_phrase_selectionner[j] = 
       $("label[for='" + ( $(this).attr("id") ) + "']").text();//Pour le fichier A1.js
   j++;
});

问题是,如果我选择六个复选框,它只返回3个复​​选框。有人对这个问题有所了解吗?

0 个答案:

没有答案
相关问题