<%@page contentType="text/html;charset=utf-8" language="java"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
[b][color=blue]<script language="javascript">
function toSubmit(str)
{
customerForm.action=str;
//alert(form1.action);
if(buyIDs.length>0)
{
buyIDs=buyIDs.substr(0,buyIDs.length-1);
customerForm.action=str+"&buyIDs="+buyIDs;
}
customerForm.submit();
}
var buyIDs="";
function addrow()
{
table1.insertRow();
var i=table1.rows.length - 1;
table1.rows(i).insertCell(0);
table1.rows(i).insertCell(0).innerHTML='<td><input type=checkbox value="" name="c1"><input name="buyName" type="text"></td>';
table1.rows(i).insertCell(1);
table1.rows(i).insertCell(1).innerHTML='<td><input name="amount" type="text"></td>';
table1.rows(i).insertCell(2);
table1.rows(i).insertCell(2).innerHTML='<select name="price"><option value="10">10</option><option value="20">20</option></select><input type="hidden" name="buyID">';
}
function deleteRow()
{
var i=table1.rows.length -1;
for(j=i;j>1;j--)
{
if(table1.rows(j).getElementsByTagName("input").item(0).checked)
{
if(table1.rows(j).getElementsByTagName("input").item(3).value.length>0)
{
buyIDs=buyIDs+table1.rows(j).getElementsByTagName("input").item(3).value+",";
}
table1.deleteRow(j);
}
}
}
</script>[/color][/b]
</head>
<body>
<html:form action="/make?method=insert">
<logic:present name="customer" scope="request">
<table width="100%" border="1" align="center">
<tr>
<td colspan="3">用户列表</td>
</tr>
<tr>
<td width="34%">用户名</td>
<td width="42%">姓别</td>
<td width="24%">年龄</td>
</tr>
<tr>
<td><input name="customerName" type="text" value="<bean:write name='customer' property='customerName' scope='request'/>"></td>
<td><input name="sex" type="text" id="sex" value="<bean:write name='customer' property='sex' scope='request'/>"></td>
<td><input name="age" type="text" id="age" value="<bean:write name='customer' property='age' scope='request'/>"></td>
</tr>
</table>
<table width="100%" border="1" id="table1">
<tr align="right">
<td colspan="3"><input type="button" name="Submit2" value="增加" onclick="addrow();">
<input type="button" name="Submit" value="删除" onclick="deleteRow();"></td>
</tr>
<tr>
<td>产品名称</td>
<td>数量</td>
<td>金额</td>
</tr>
<logic:iterate id="buy" name="customer" property="buies" scope="request">
<tr>
<td>
<input type=checkbox value="" name="c1">
<input name="buyName" type="text" value="<bean:write name='buy' property='buyName'/>"></td>
<td>
<input name="amount" type="text" value="<bean:write name='buy' property='amount'/>">
</td>
<td><select name="price">
<option value="10" >10</option>
<option value="20" >20</option>
</select>
<input type="hidden" name="buyID" value="<bean:write name='buy' property='buyID'/>">
</td>
</tr>
</logic:iterate>
</table>
</logic:present>
<logic:notPresent name="customer" scope="request">
<table width="100%" border="1" align="center">
<tr>
<td colspan="3">用户列表</td>
</tr>
<tr>
<td width="34%">用户名</td>
<td width="42%">姓别</td>
<td width="24%">年龄</td>
</tr>
<tr>
<td><input name="customerName" type="text"></td>
<td><input name="sex" type="text" id="sex" ></td>
<td><input name="age" type="text" id="age" ></td>
</tr>
</table>
<table width="100%" border="1" id="table1">
<tr align="right">
<td colspan="3"><input type="button" name="Submit2" value="增加" onclick="addrow();">
<input type="button" name="Submit" value="删除" onclick="deleteRow();"></td>
</tr>
<tr>
<td>产品名称</td>
<td>数量</td>
<td>金额</td>
</tr>
<tr>
<td>
<input type=checkbox value="" name="c1">
<input name="buyName" type="text" ></td>
<td>
<input name="amount" type="text" >
</td>
<td><select name="price">
<option value="10" >10</option>
<option value="20" >20</option>
</select>
<input type="hidden" name="buyID">
</td>
</tr>
</table>
</logic:notPresent>
<p>
<input type="button" name="Submit" value="增加" onclick="toSubmit('make.do?method=insert');">
<input type="button" name="Submit" value="修改" onclick="toSubmit('make.do?method=update');">
<input type="button" name="Submit" value="删除" onclick="toSubmit('make.do?method=delete');">
<input type="button" name="Submit" value="查询" onclick="toSubmit('make.do?method=select');">
</p>
</html:form>
</body>
</html>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
[b][color=blue]<script language="javascript">
function toSubmit(str)
{
customerForm.action=str;
//alert(form1.action);
if(buyIDs.length>0)
{
buyIDs=buyIDs.substr(0,buyIDs.length-1);
customerForm.action=str+"&buyIDs="+buyIDs;
}
customerForm.submit();
}
var buyIDs="";
function addrow()
{
table1.insertRow();
var i=table1.rows.length - 1;
table1.rows(i).insertCell(0);
table1.rows(i).insertCell(0).innerHTML='<td><input type=checkbox value="" name="c1"><input name="buyName" type="text"></td>';
table1.rows(i).insertCell(1);
table1.rows(i).insertCell(1).innerHTML='<td><input name="amount" type="text"></td>';
table1.rows(i).insertCell(2);
table1.rows(i).insertCell(2).innerHTML='<select name="price"><option value="10">10</option><option value="20">20</option></select><input type="hidden" name="buyID">';
}
function deleteRow()
{
var i=table1.rows.length -1;
for(j=i;j>1;j--)
{
if(table1.rows(j).getElementsByTagName("input").item(0).checked)
{
if(table1.rows(j).getElementsByTagName("input").item(3).value.length>0)
{
buyIDs=buyIDs+table1.rows(j).getElementsByTagName("input").item(3).value+",";
}
table1.deleteRow(j);
}
}
}
</script>[/color][/b]
</head>
<body>
<html:form action="/make?method=insert">
<logic:present name="customer" scope="request">
<table width="100%" border="1" align="center">
<tr>
<td colspan="3">用户列表</td>
</tr>
<tr>
<td width="34%">用户名</td>
<td width="42%">姓别</td>
<td width="24%">年龄</td>
</tr>
<tr>
<td><input name="customerName" type="text" value="<bean:write name='customer' property='customerName' scope='request'/>"></td>
<td><input name="sex" type="text" id="sex" value="<bean:write name='customer' property='sex' scope='request'/>"></td>
<td><input name="age" type="text" id="age" value="<bean:write name='customer' property='age' scope='request'/>"></td>
</tr>
</table>
<table width="100%" border="1" id="table1">
<tr align="right">
<td colspan="3"><input type="button" name="Submit2" value="增加" onclick="addrow();">
<input type="button" name="Submit" value="删除" onclick="deleteRow();"></td>
</tr>
<tr>
<td>产品名称</td>
<td>数量</td>
<td>金额</td>
</tr>
<logic:iterate id="buy" name="customer" property="buies" scope="request">
<tr>
<td>
<input type=checkbox value="" name="c1">
<input name="buyName" type="text" value="<bean:write name='buy' property='buyName'/>"></td>
<td>
<input name="amount" type="text" value="<bean:write name='buy' property='amount'/>">
</td>
<td><select name="price">
<option value="10" >10</option>
<option value="20" >20</option>
</select>
<input type="hidden" name="buyID" value="<bean:write name='buy' property='buyID'/>">
</td>
</tr>
</logic:iterate>
</table>
</logic:present>
<logic:notPresent name="customer" scope="request">
<table width="100%" border="1" align="center">
<tr>
<td colspan="3">用户列表</td>
</tr>
<tr>
<td width="34%">用户名</td>
<td width="42%">姓别</td>
<td width="24%">年龄</td>
</tr>
<tr>
<td><input name="customerName" type="text"></td>
<td><input name="sex" type="text" id="sex" ></td>
<td><input name="age" type="text" id="age" ></td>
</tr>
</table>
<table width="100%" border="1" id="table1">
<tr align="right">
<td colspan="3"><input type="button" name="Submit2" value="增加" onclick="addrow();">
<input type="button" name="Submit" value="删除" onclick="deleteRow();"></td>
</tr>
<tr>
<td>产品名称</td>
<td>数量</td>
<td>金额</td>
</tr>
<tr>
<td>
<input type=checkbox value="" name="c1">
<input name="buyName" type="text" ></td>
<td>
<input name="amount" type="text" >
</td>
<td><select name="price">
<option value="10" >10</option>
<option value="20" >20</option>
</select>
<input type="hidden" name="buyID">
</td>
</tr>
</table>
</logic:notPresent>
<p>
<input type="button" name="Submit" value="增加" onclick="toSubmit('make.do?method=insert');">
<input type="button" name="Submit" value="修改" onclick="toSubmit('make.do?method=update');">
<input type="button" name="Submit" value="删除" onclick="toSubmit('make.do?method=delete');">
<input type="button" name="Submit" value="查询" onclick="toSubmit('make.do?method=select');">
</p>
</html:form>
</body>
</html>
916

被折叠的 条评论
为什么被折叠?



