我有一个页面显示来自我的数据库的信息。我需要用户能够单击“详细信息”链接以查看与记录有关的更多信息,或者单击输入框(“检查”列),然后提交,这将更新记录的状态。为此,我需要从“id”列中获取 id。
这是页面的样子:
这是创建它的代码:
$.ajax({
type: "POST",
url: "lib/req.reqinfo.php",
async: false,
data: {},
success: function(response){
// alert(response);
var responseArray = response.split(',');
for(var x=0;x<responseArray.length;x++){
id = responseArray[x]; x++;
dateadded = responseArray[x]; x++;
needby = responseArray[x]; x++;
addedby = responseArray[x]; x++;
unit = responseArray[x]; x++;
appr = responseArray[x];
$("#dbinfo").append('<br /><div class="row"><div id="idrow'+x+'" class="onecol bg">'+id+'</div><div class="twocol bg">'+dateadded+'</div><div class="twocol bg">'+needby+'</div><div class="twocol bg">'+addedby+'</div><div class="twocol bg">'+unit+'</div><div class="onecol bg">'+appr+'</div><div class="onecol bg"><label id="detaillink" class="link"><a href="#">details</a></label></div><div class="onecol bg last">'+check+'</div></div>');
}
我似乎找不到指向该特定 div 以提取所需信息的解决方案
html:
<div class="container">
<br />
<div id="dbinfo" class="row center">
<div class="onecol bg">ID</div>
<div class="twocol bg">Date Added</div>
<div class="twocol bg">Need By</div>
<div class="twocol bg">Added By</div>
<div class="twocol bg">Unit #</div>
<div class="onecol bg">Appr.</div>
<div class="onecol bg">Details</div>
<div class="onecol bg last">check</div>
<div class="onecol">   </div>
</div>
<br />
<div class="row">
<label class="link"><a href="home.php">Home</a></label>
</div>