我正在尝试将数据库参数传递到表中,其中显示所选项的内容。以下是我尝试这样做的方法:
function secondAcc(){
$('input:checked').each(function(i) {
subsetofmymembers[i]=mymembers[$(this).attr('id')];
});
$('#username').val(subsetmymembers[0].username);
$('#fname').val(subsetmymembers[0].fname);
$('#lname').val(subsetmymembers[0].lname);
$('#address1').val(subsetmymembers[0].address1);
$('#town').val(subsetmymembers[0].town);
$('#county').val(subsetmymembers[0].county);
$('#postcode').val(subsetmymembers[0].postcode);
$('#phone').val(subsetmymembers[0].phone);
$('#email').val(subsetmymembers[0].email);
$('#status').val(subsetmymembers[0].status);
}
当我单击手风琴以查看所选项目时,会调用secondAcc。但它只显示第一条记录(我没有点击过)。我不确定如何解决这个问题。有人能帮忙吗?