【发布时间】:2017-04-28 08:17:58
【问题描述】:
我正在根据来自 DB 的输入创建一个表,并将其显示在我的 div 中,如下所示:
小服务程序:
out.print("<table id=prev class=display nowrap stripe row-border order-column>");
out.print("<thead>");
out.print("<tr>" +
"<th>Form Id</th>\n" +
" <th>Form Name</th>\n" +
" <th>Open</th>\n" +
" <th>Report</th>\n" +
" <th>View</th>\n" +
" <th>Insert</th>\n" +
" <th>Update</th>\n" +
" <th>Delete</th>\n" +
" <th>Approve Transaction</th>\n" +
" <th>Reject Transaction</th>\n" +
" </tr>");
out.print("</thead>");
out.print("<tfoot>");
out.print("<tr>" +
"<th>Form Id</th>\n" +
" <th>Form Name</th>\n" +
" <th>Open</th>\n" +
" <th>Report</th>\n" +
" <th>View</th>\n" +
" <th>Insert</th>\n" +
" <th>Update</th>\n" +
" <th>Delete</th>\n" +
" <th>Approve Transaction</th>\n" +
" <th>Reject Transaction</th>\n" +
" </tr>");
out.print("</tfoot>");
out.println("<tbody>");
while(rs1.next())
{out.print("<tr><td name=prvlg>"+rs1.getInt("FORM_ID")+"</td>"
+ "<td name=prvlg>"+rs1.getString("FORM_NAME")+"</td>");
if(form1==1){ out.print("<td name=prvlg><input type=checkbox checked=checked></td>");}
else { out.print("<td name=prvlg><input type=checkbox></td>");}
if(report==1)
{ out.print("<td name=prvlg><input type=checkbox checked=checked></td>");}
else { out.print("<td name=prvlg><input type=checkbox></td>");}
if(view==1)
{ out.print("<td name=prvlg><input type=checkbox checked=checked></td>");}
else { out.print("<td name=prvlg><input type=checkbox></td>");}
if(insert1==1)
{ out.print("<td name=prvlg><input type=checkbox checked=checked></td>");}
else { out.print("<td name=prvlg><input type=checkbox></td>");}
if(update==1)
{ out.print("<td name=prvlg><input type=checkbox checked=checked></td>");}
else { out.print("<td name=prvlg><input type=checkbox></td>");}
if(delete==1)
{ out.print("<td name=prvlg><input type=checkbox checked=checked></td>");}
else { out.print("<td name=prvlg><input type=checkbox></td>");}
if(isapproved==1)
{ out.print("<td name=prvlg><input type=checkbox checked=checked></td>");}
else { out.print("<td name=prvlg><input type=checkbox></td>");}
if(not_approved==1)
{ out.print("<td name=prvlg><input type=checkbox checked=checked></td>");}
else { out.print("<td name=prvlg><input type=checkbox></td>");}
}
out.print("</tbody></table>");
}
并在此处显示:
if ((zreq.readyState == 4) && (zreq.status == 200)) {
document.getElementById("user_prev").innerHTML = zreq.responseText;
$("#parent").DataTable({
dom: 't',
});
并且 div 在表单内。提交时,所有其他信息都被提交,但表格内容除外。
String td[]=request.getParameterValues("prvlg");
它始终为空。谁能建议我哪里出错了?
【问题讨论】:
标签: javascript jquery forms jsp servlets