I'm having trouble populating my Listbox, I can populate the Listbox with the checkboxes values of the not with the corresponding Labels. I'm running short of how I'm going to do this.
The checkboxes list is populated with jquery, in the following way:
itensNomesCatequizandos.append(catequizando.Nome + '<br />');
itensCheckBoxCatequizandos.append('<input type="checkbox" name="SelectedCatequizandos[]" value="' + catequizando.PessoaID + '">' + '<br />');
My ListBox fills all names in a single mine:
<script>
function addListbox() {
var itensListBoxCatequizandos = $("#SelectedCatequizandos");
itensListBoxCatequizandos.empty();
var myCheckboxes = new Array();
$("input:checked").each(function () {
myCheckboxes.push($(this).val());
$.each($('.NomesCatequizando'), function (index, Nome) {
$.each(myCheckboxes, function (index, value) {
itensListBoxCatequizandos.append('<option value="' + value.myCheckboxes + '">' + $(Nome).text() + '</option>');
});
});
});
}
</script>
Where do I get the text to populate the ListBox:
<td id="NomesCatequizando" class="NomesCatequizando"></td>