67,513
社区成员
发帖
与我相关
我的任务
分享
<%@ 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 HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript" src="js/jquery-2.1.1.js"></script>
<script type="text/javascript">
function showPrice() {
var m_id = $("#mySelect").val();
var price = $("#" + m_id).val();
$("#pricediv").html(price);
}
</script>
</head>
<body>
请选择材质:
<br>
<c:if test="${not empty materialList }">
<select name="mySelect" id="mySelect" onchange="showPrice();">
<option>----请选择----</option>
<c:forEach items="${materialList}" var="u">
<option id="id" value="${u.m_id }">${u.m_id }、${u.material}</option>
</c:forEach>
</select>
<c:forEach items="${materialList}" var="u">
<input id="${u.m_id }" value="${u.price }" type="hidden"></input>
<input id="${u.m_id }" value="${u.m_id }" type="hidden"></input>
</c:forEach>
<div id="pricediv"></div>
</c:if>
<br> 请选择产品类别:
<br>
<c:if test="${not empty categoryList }">
<select>
<option>----请选择----</option>
<c:forEach items="${categoryList }" var="c">
<option id="category" value="${c.c_id }">${c.c_id }、${c.category }</option>
</c:forEach>
</select>
</c:if>
<br>
<br> 请选择包装类型:
<br>
<c:if test="${not empty packageList }">
<select>
<option>----请选择----</option>
<c:forEach items="${packageList }" var="p">
<option value="${p.p_id }">${p.p_id }、${p.packaging }</option>
</c:forEach>
</select>
</c:if>
<br>
<br> 请选择表面处理:
<br>
<c:if test="${not empty surfaceList }">
<select>
<option>----请选择----</option>
<c:forEach items="${surfaceList }" var="s">
<option value="${s.s_id }">${s.s_id }、${s.surface }</option>
</c:forEach>
</select>
</c:if>
<br>
<br>
</body>
</html>