<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
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 'update.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-1.8.2.js"></script>
<script type="text/javascript">
var id = "${param.id}";
$.post(
"p_getData",
{"phone.pid":id},
function (data){
var downList = data.downList;
for ( var i in downList) {
$("select").append("<option value="+downList[i].bid+">"+downList[i].bname+"</option>");
}
var phone = data.phone;
$("[name='phone.pid']").val(phone.pid);
$("[name='phone.price']").val(phone.price);
$("[name='phone.pdate']").val(phone.pdate);
$("[name='phone.pnum']").val(phone.pnum);
$("[name='phone.b.bid']").val(phone.b.bid);
},"json"
);
function sub(){
$.post(
"p_update",
$("form").serialize(),
function (msg){
if(msg==1){
alert("提交成功");
location="p_list";
}else{
alert("提交失败");
}
},"text"
);
}
</script>
</head>
<body>
<form>
pid:<input name="phone.pid"><br>
price:<input name="phone.price"><br>
pdate:<input name="phone.pdate"><br>
pnum:<input name="phone.pnum"><br>
bid:<select name="phone.b.bid">
</select>
</form>
<input type="button" value="提交" onclick="sub()">
</body>
</html>
一个人要多么勇敢,才敢在夜里独自回忆心伤
一段伤要多么刻骨,才会明知心肠破碎也不敢却忘