📄 goodinsert.jsp~21~
字号:
<%@ page contentType="text/html; charset=gb2312"%>
<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<%@page import="com.domain.BigTypeForm"%>
<%@page import="com.domain.SmallTypeForm"%>
<jsp:useBean id="big" scope="page" class="com.dao.BigTypeDao"/>
<jsp:useBean id="small" scope="page" class="com.dao.SmallTypeDao"/>
<%
List bigList=big.selectBig();
String id=(String)request.getAttribute("bigId");
Integer bigId=Integer.valueOf(id);
List smallList=small.selectOneBigId(bigId);
%>
<script language="javascript">
function checkEmpty(form){
for(i=0;i<form.length;i++){
if(form.elements[i].value==""){
alert("表单信息不能为空");
return false;
}
}
}
function ChangeItem(){
var big=form.big.value;
window.location.href="goodsAction.do?action=2&bigId="+big;
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>电子商城的后台<%=bigId%></title>
</head>
<link href="css/css.css" rel="stylesheet" type="text/css">
<body>
<table width="755" height="100%" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="104" colspan="2"> <div align="center"><jsp:include page="../upOne.jsp"/> </div> </td>
</tr>
<tr>
<td height="15" colspan="2"><div align="center">
<jsp:include page="../upTwo.jsp"/>
</div></td>
</tr>
<tr>
<td width="24%" height="318"><jsp:include page="../../leftManager.jsp"/> </td>
<td width="76%" height="36"><div align="right"></div>
<div align="center"> <strong>添加商品信息</strong><br>
<form action="#" method="post" enctype="multipart/form-data" name="form" onSubmit="return checkEmpty(form)" >
<table width="90%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="20%" height="26"> 所属大类别</td>
<td width="31%"> <select name="big" onChange="ChangeItem()"><option value="">请选择</option>
<%for(int i=0;i<bigList.size();i++){
BigTypeForm bigForm=(BigTypeForm)bigList.get(i);
%>
<option value="<%=bigForm.getId()%>" <%if(bigId.equals(bigForm.getId())){out.println("selected");}%>>
<%=big.selectName(bigForm.getId())%>
</option>
<%}%>
</select></td>
<td width="20%"> 所属于小类别</td>
<td width="31%"> <select name="small"><option value="">请选择</option>
<%for(int i=0;i<smallList.size();i++){
SmallTypeForm small=(SmallTypeForm)smallList.get(i);
%>
<option value="<%=small.getId()%>"><%=small.getSmallName()%></option>
<%}%>
</select></td>
</tr>
<tr>
<td height="25"> 商品名称</td>
<td> <input name="textfield" type="text" size="20"></td>
<td> 生产厂商</td>
<td> <input name="textfield2" type="text" size="20"></td>
</tr>
<tr>
<td height="27"> 商品定价</td>
<td> <input name="textfield3" type="text" size="20"></td>
<td> 初始化特价</td>
<td> <input name="textfield4" type="text" size="20"></td>
</tr>
<tr>
<td height="28"> 商品描述</td>
<td colspan="3"> <input name="textfield5" type="text" size="50"></td>
</tr>
<tr>
<td height="28"> 图片地址</td>
<td colspan="3">
<input type="file" name="file"></td>
</tr>
</table>
<p>
<input type="submit" name="Submit2" value="提交">
<input type="reset" name="reset" value="清除">
<input type="button" name="back" value="返回" onClick="javasrcipt:history.go(-1)">
</p>
</form>
<p> </p>
<p> </p>
</div></td>
</tr>
<tr>
<td height="60" colspan="2"><p align="center"><jsp:include page="../downNews.jsp"/>
</p> </td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -