在表单的table中的每一个单元格加入俩个下拉菜单,求大神指导怎么写?下面有初步的jsp代码。我用的是SSH框架.有一个下拉菜单的值是动态的,是别的表内的属性。怎么把一个单元格里的两个数据分别确定
<%@page contentType="text/html; charset=UTF-8" import="java.util.*" %>
<%@ page import="com.sysgrrj.module.ChangFangGouMai.valueobject.ChangFangGouMai" %>
<%@ page import="com.sysgrrj.common.TypeChange" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<jsp:include page='/res/inc/inc.jsp' flush='true'/>
</head>
<body>
<s:form action="List" id="form1" theme="simple">
<jsp:include page='/res/inc/inc_form_List.jsp' flush='true'/>
<script type="text/javascript">
function doAction(action) {
if (confirm("是否确认保存?")) {
document.getElementById("form1").action = "<%=request.getContextPath()%>/Module/ChangFangGouMai/List_save.action";
document.getElementById("form1").submit();
return true;
}
else {
return false;
}
}
</script>
<div class="buttonDiv">
<input type="button" class="button_style_save" onclick="doAction('')"/>
</div>
<div class="validatemsg">
<s:actionerror/>
<s:fielderror/>
<s:actionmessage/>
</div>
<%
//厂房购买
List<ChangFangGouMai> changFangGouMaiList = (List<ChangFangGouMai>) request.getAttribute("changFangGouMaiList");
%>
<table width="100%" class="listext" id="table1">
<tr>
<TH colspan="7" style="background: #EBEBEB;height: 35px"> 厂房购买</TH>
</tr>
<TR>
<TH width="30"> 序号</TH>
<TH width="80">编号</TH>
<TH>1</TH>
<TH>2</TH>
<TH>3</TH>
<TH>4</TH>
<%--<TH>trainingOrCompetitionID</TH>--%>
</TR>
<% int i;
int k;
int j;
String[] s;
s=new String[6];
for(j=1;j<7;j++){
String a[]={"第一年","第二年","第三年","第四年","第五年","第六年"};
%>
<TR>
<TD><%=(j)%> </TD>
<TD><%=(a[j-1])%> </TD>
<%
for(i=1;i<5;i++){
out.print(" <TD>");
String sr= "";
for(k=0;k<changFangGouMaiList.size();k++){
ChangFangGouMai changFangGouMai=changFangGouMaiList.get(k);
if(TypeChange.stringToInt(changFangGouMai.getNianDu())==j&&changFangGouMai.getBianHao()==i){
sr=changFangGouMai.getZuYongHuoGouMai();
break;
}
}
out.print("<input type=\"text\" name=\""+j+"_"+i+"\" value=\"" + sr + "\"/>");
out.print("</TD>");
}
%>
</TR>
<%
}
%>
</TABLE>
<s:hidden name="TrainingOrCompetitionID"/>
</s:form>
</body>
</html>