主题:急救
各位朋友帮帮忙,我想从下面表单中获取name的值,然后在数据库中将获取的name值作为条件查询,请问有什么办法?这里的name值是从数据库中选出的一个字段。因为这个字段随时有变动,不能固定写某个值。
<form name=rzlForm action="pageProc.jsp" method="post">
<table width="32%" border="1" height="31" cellspacing=1 align="center">
<tr align="center" bgcolor="#dddddd" height=30>
<td height="22" bgcolor="#dddddd">片区名称</td>
<td height="22">估产量(吨)</td>
<td height="22">入榨量(吨)</td>
</tr>
<%!ResultSet rs01=null;%>
<%
try
{
rs01=dbBean.executeQuery("select field,sum(ruYield)from peasantInfo GROUP BY field ");
while (rs01.next())
{
String NAME_PQ;
NAME_PQ=getStr(rs01.getString("field"));
%>
<tr align="center" bgcolor="#dddddd" height=30>
<td width="9%" height="22" bgcolor="#dddddd" ><%=rs01.getString(1)%> </td>
<td width="9%" height="22" bgcolor="#FFFFFF" ><%=rs01.getDouble(2)%> </td>
<td width="9%" height="22" bgcolor="#dddddd" >
<%out.print("<input type='text' size='12' name="+NAME_PQ+" value='' onkeydown='onlyNum()'>");%>
</td>
</tr>
<% }
}
catch(Exception e){}
rs01.close();
%>
</table>
<div align="center">
<p>
<Input type="submit" name="submitOK" value="确定">
<Input type="reset" name="重填" value="重填">
</p>
</div>
</form>
<form name=rzlForm action="pageProc.jsp" method="post">
<table width="32%" border="1" height="31" cellspacing=1 align="center">
<tr align="center" bgcolor="#dddddd" height=30>
<td height="22" bgcolor="#dddddd">片区名称</td>
<td height="22">估产量(吨)</td>
<td height="22">入榨量(吨)</td>
</tr>
<%!ResultSet rs01=null;%>
<%
try
{
rs01=dbBean.executeQuery("select field,sum(ruYield)from peasantInfo GROUP BY field ");
while (rs01.next())
{
String NAME_PQ;
NAME_PQ=getStr(rs01.getString("field"));
%>
<tr align="center" bgcolor="#dddddd" height=30>
<td width="9%" height="22" bgcolor="#dddddd" ><%=rs01.getString(1)%> </td>
<td width="9%" height="22" bgcolor="#FFFFFF" ><%=rs01.getDouble(2)%> </td>
<td width="9%" height="22" bgcolor="#dddddd" >
<%out.print("<input type='text' size='12' name="+NAME_PQ+" value='' onkeydown='onlyNum()'>");%>
</td>
</tr>
<% }
}
catch(Exception e){}
rs01.close();
%>
</table>
<div align="center">
<p>
<Input type="submit" name="submitOK" value="确定">
<Input type="reset" name="重填" value="重填">
</p>
</div>
</form>