`
chaoyi
  • 浏览: 290147 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

后台jsp goodsNew.jsp

 
阅读更多
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<base href="<%=basePath%>">
<title></title>
<link rel="stylesheet" href="admin/css/basic.css" type="text/css" />
<link rel="stylesheet" href="admin/css/goods.css" type="text/css" />
<script type="text/javascript" src="admin/js/goods.js"></script>
</head>

<body>
	<form action="goodsNew" method="post">
		<div class="fillIn">
			<table cellpadding="0" cellspacing="0">
				<tr class="explain">
					<td colspan="8">新增商品内容</td>
				</tr>
				<tr class="item">
					<td class="key">商品编号</td>
					<td class="value">1</td>
					<td class="key">商品类型</td>
					<td class="value">
					<select name="classifyId" onblur="javascript:ajaxBrandbyclassifyId(this);">
							<c:forEach var="item" items="${pcList}" varStatus="i">  
							<option  value="${item.products_classify_id  }" <c:if test="${pItem.classifyId eq item.products_classify_id }">selected="selected"</c:if>>${item.products_classify_content }</option>
							</c:forEach>
					</select>
					</td>
					<td class="key">商品品牌</td>
					<td class="value">
					<select name="brandId" id="brand">
						<option>--请先择类型--</option>
					</select>
					</td>
					<td class="key">商品型号</td>
					<td class="value"><input type="text" value="请输入型号" name="model"
						style=" width:120px;" />(50字节之内)</td>
				</tr>
				<tr class="item">
					<td class="key">商品价格</td>
					<td class="value"><input type="text" value="100.00" name="price"
						style="width:60px;" />
					</td>
					<td class="key">商品库存</td>
					<td class="value"><input type="text" value="1" name="number"
						style="width:42px;" />
					</td>
					<td class="key">商品状态</td>
					<td class="value">
					<select name="statusId">
							<c:forEach var="item" items="${psList}" varStatus="i">  
							<option  value="${item.products_status_id  }" <c:if test="${pItem.status_id eq '1' }">selected="selected"</c:if>>${item.products_status_content }</option>
							</c:forEach>
					</select>
					</td>
					<td class="key">上传时间</td>
					<td class="value">默认你插入数据的时间</td>
				</tr>
				<tr class="item">
					<td class="key">商品介绍</td>
					<td class="value" colspan="9"><input type="text" value="请输入介绍" name="introduce"
						style=" width:920px;" />(120字节之内)</td>
				</tr>
				<tr class="item">
					<td class="key">商品描述</td>
					<td class="value" colspan="9"><input type="text" value="请输入描述" name="bewrite"
						style=" width:920px;" />(120字节之内)</td>
				</tr>
				<tr class="update">
					<td colspan="8"><input type="submit" class="submit f_r"
						value="新增" />
					</td>
				</tr>
			</table>
		</div>
	</form>
	<div style="height:30px;"></div>
</body>
</html>

 

/* CSS Document */
.submit{ background:#f7661f; color:#fff; text-align:center; width:46px; height:21px; line-height:21px; border:none; border-radius:3px; font-family:"Arial";}
.submit:hover{ background:#ff971c;}

.search{ width:1100px; margin:0 auto 20px auto;}
.search table{width:100%; border:1px solid #ccc;}
.searchInput{ background:#f4f4f4; height:34px;}
.searchInput form{ display:inline; margin-left:10px; margin-right:8px;}
.searchInput .text{ border:1px solid #ccc; height:18px; line-height:18px; padding-left:6px; font-family:"Arial"; width:80px;}

.fillIn{ width:1100px; margin:0 auto;}
.fillIn table{ width:100%; border-top:1px solid #ccc; border-left:1px solid #ccc;}
.fillIn table td{ height:21px; text-align:center; border-bottom:1px solid #ccc; border-right:1px solid #ccc;}
.fillIn table .explain td{ background:#f4f4f4; font-family:"微软雅黑"; color:#333; font-weight:bold;}
.fillIn table .item .key{ background:#436da8; color:#fff; font-family:"微软雅黑";}
.fillIn table .item .value{ color:#333; font-family:"微软雅黑";}
.fillIn table .item .value input{ color:#c00; border:none; font-family:"微软雅黑";}
.fillIn table .item .value select{ color:#c00; border:none; font-family:"微软雅黑";}
.fillIn table .item .value select option{ color:#c00; border:none; font-family:"微软雅黑";}
.fillIn table .update td{ height:28px; padding-right:10px;}

.upload{ width:1100px; margin:20px auto 0 auto;}
.upload table{ width:100%; border-top:1px solid #ccc; border-left:1px solid #ccc;}
.upload table td{ height:21px; text-align:center; border-bottom:1px solid #ccc; border-right:1px solid #ccc;}
.upload table .explain td{ background:#f4f4f4; font-family:"微软雅黑"; color:#333; font-weight:bold;}
.upload table .item .key{ background:#436da8; color:#fff; font-family:"微软雅黑"; text-align:right; padding-right:10px;}
.upload table .item .value{ color:#333; font-family:"微软雅黑";}
.upload table .item .value input{ color:#c00; border:none; font-family:"微软雅黑";}
.upload table .item .value select{ color:#c00; border:none; font-family:"微软雅黑";}
.upload table .item .value select option{ color:#c00; border:none; font-family:"微软雅黑";}
.upload table .update td{ height:28px; padding-right:10px;}

 

//JavaScript Document
function $(id){  
	return document.getElementById(id);  
} 

function ajaxBrandbyclassifyId(obj){
	var brand = $("brand");
	brand.innerHTML="";
	var xmlHttp = new XMLHttpRequest();
	var url = "ajaxBrandbyclassifyId?classifyId="+escape(obj.value);
	xmlHttp.open("GET", url);//设置一个请求
	xmlHttp.onreadystatechange = function() {	//设置请求完成之后处理的回调函数  
		if (xmlHttp.readyState == 4) {//数据返回完毕  
			if (xmlHttp.status == 200) {//HTTP操作正常  
				var text = xmlHttp.responseText;//接收返回的内容  
				brand.innerHTML= text;
			}
		}
	};
	xmlHttp.send(null);//发送请求,不传递任何参数  	
}

 

效果图:

 

 

 

 

 

  • 大小: 50.9 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics