⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bind.jsp~2~

📁 本文件中还有JSP、php和delphi等源程序
💻 JSP~2~
字号:
<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<html>
<head>
 <link rel="STYLESHEET" type="text/css" href="css/shared.css">
<title>
bind
</title>
<script language="javascript">
var selectedTr = null;
function setTrColor(colorTr,color)
{
 if(colorTr.tagName=="TR")
 {
  for(var i=0;i<colorTr.childNodes.length;i++)
  {
   colorTr.childNodes(i).style.backgroundColor = color;
   colorTr.childNodes(i).children(0).style.backgroundColor = color;
  }
 }
}
function addcustomer()
{
     document.customerActionForm.operation.value = "add";
     document.customerActionForm.submit();
}
function deletecustomer()
{

     if(selectedTr!=null)
    {   alert(selectedTr.childNodes(0).children(1).value);
	if(selectedTr.childNodes(0).children(1).value!=0&&selectedTr.childNodes(0).children(1).value!=null)
        {
		document.customerActionForm.deleteUID.value = selectedTr.childNodes(0).children(1).value;
		document.customerActionForm.operation.value="delete";
		customerRows.removeChild(selectedTr);
       		selectedTr = null;
       		document.customerActionForm.submit();
        }else
	{
		customerRows.removeChild(selectedTr);
		selectedTr = null;
	}
    }
}
function savecustomer()
{

 	document.customerActionForm.operation.value = "save";
	document.customerActionForm.submit();
}
function onClickedCell()
{
 var clickedcell = event.srcElement;
 if(selectedTr!=null)
{
  setTrColor(selectedTr,"#FFFFFF");
}
 while(clickedcell.tagName!="TR")
 {
   clickedcell = clickedcell.parentElement;
 }
 selectedTr = clickedcell;
 setTrColor(selectedTr,"#FFDDFF");
}
</script>
</head>
<body bgcolor="#ffffff" >
<h3 align="center">
订单录入信息
</h3>
<br>
<hr height=1 />
<html:form method="post" action="customerAction.do">
<html:hidden name="customerActionForm" property="deleteUID" />
<html:hidden name="customerActionForm" property="operation"/>
<table width="100%">
<tr>
<td class="tdframe">
<table class="table1"  width="100%">
<thead class="tdsectionbar">
<td align="center" class="tdsectionbar" >客户名称</td>
<td align="center" class="tdsectionbar" >客户邮箱</td>
<td align="center" class="tdsectionbar" >客户电话</td>
<td align="center" class="tdsectionbar" >客户地址</td>
</thead>
<tbody id="customerRows" onclick="onClickedCell()">
<logic:iterate name="customerActionForm" property="customers" id="customers">
<tr class="tdsectionbar">
<td class="tdbg0" >
<html:text indexed="true" name="customers" property="customerName" />
<html:hidden indexed="true" name="customers" property="customerUID" />
</td>
<td class="tdbg0" >
<html:text indexed="true" name="customers" property="email" />
</td>
<td class="tdbg0">
<html:text indexed="true" name="customers" property="phone" />
</td>
<td class="tdbg0" >
<html:text indexed="true" name="customers" property="address" />
</td>
</tr>
</logic:iterate>
</tbody>
</table>
</td>
</tr>
</table>
</html:form>
<br><br>
<input type="button" value="添加客户" class="button" onclick="addcustomer();"/>
<input type="button" value="删除客户" class="button" onclick="deletecustomer();"/>
<input type="button" value="保存客户" class="button" onclick="savecustomer();"/>
<hr height=1 />
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -