📄 rightbook.jsp
字号:
<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript" language="javascript">
//点击添加书籍按钮时进行form表单提交进行添加书籍
function doAddSubmit(servletName){
document.form2.action=servletName;
document.form2.submit();
}
//点击删除按钮时进行form表单提交进行删除书籍
function doDeleteSubmit(servletName){
//当点击确定按钮时才进行书籍删除操作
if(confirm("确定删除")){
document.form2.action=servletName+"?bid="+document.form2.bid.value;
document.form2.submit();
}
}
//点击修改按钮时进行form表单提交进行书籍更新
function doUpdateSubmit(servletName){
document.form2.action=servletName;
document.form2.submit();
}
//在窗体加载时根据大类,小类,出版社的ID自动选择类别和出版社
function doLoad(){
var conc=document.form2.conc.value;
var tid=document.form2.tid.value;
var oid=document.form2.oid.value;
//如果没有出版社ID就不能进行自动选择
if(conc!="" && conc!=null){
document.form2.bookConcem.options[parseInt(conc)].selected=true;
}
//如果没有小类ID就不能进行自动选择
if(tid!="" && tid!=null){
document.form2.bigType.options[parseInt(tid)].selected=true;
}
//如果没有大类ID就不能进行自动选择
if(oid!="" && oid!=null){
document.form2.smallType2.options[parseInt(oid)].selected=true;
}
}
//改变小类书籍值的时候
function changeForSmallType(){
alert(document.form2.smallType2.value);
}
</script>
<script type="text/javascript" language="javascript" src="../js/WdatePicker.js"></script>
<style type="text/css">
<!--
body,td,th {
font-size: 9pt;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #B6C850;
}
input{
width:500;
}
-->
</style></head>
<body onLoad="doLoad()" ><br />
<br />
<form name="form1" method="post" action="../servlet/ShowBookServlet">
<table style="border-top:1px solid #96C334;border-bottom:1px solid #96C334;" width="95%" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="16%"> 请输入书籍名称查询:</td>
<td width="84%">
<input type="text" name="bookName">
<input type="submit" name="Submit" style="width:40" value="查询"></td>
</tr>
</table>
</form>
<form name="form2" method="post" action="" ENCTYPE="multipart/form-data">
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="16%" height="30"> 书籍名称:</td>
<td width="84%" height="30">
<input name="bkName" type="text" value="${book.bookName}"/>
<input type="hidden" name="bid" value="${book.id }" />
</tr>
<tr>
<td width="16%" height="30"> 书籍类别:</td>
<td width="84%" height="30">
<select name="bigType">
<option value="0">请在这里选择大类</option>
<c:forEach var="type" items="${requestScope.types}">
<option value="${type.id}" ><c:out value="${type.typeName}"></c:out></option>
</c:forEach>
</select>
<input type="hidden" name="oid" value="${book.bookType.oid}" />
<select onChange="changeForSmallType()" name="smallType2">
<option value="0">请在这里选择小类</option>
<c:forEach var="type2" items="${requestScope.types}">
<c:forEach var="smallType" items="${type2.bookType}">
<option value="${smallType.id }"><c:out value="${smallType.typeName }"></c:out></option>
</c:forEach>
</c:forEach>
</select>
<input type="hidden" name="tid" value="${book.bookType.id}" />
</tr>
<tr>
<td height="30"> ISBN:</td>
<td height="30">
<input type="text" name="ISBN" value="${book.isbn }"></td>
</tr>
<tr>
<td height="30"> 出版社:</td>
<td height="30">
<select name="bookConcem">
<option selected value="请选择出版社">请选择出版社</option>
<c:forEach var="concem" items="${concems}">
<option value="${concem.concemName}"><c:out value="${concem.concemName }" /></option>
</c:forEach>
<input type="hidden" name="conc" value="${book.concem.cid}" />
</select>
</tr>
<tr>
<td height="30"> 出版时间:</td>
<td height="30">
<input name="publishTime" id="d12" type="text" value="${book.publishTime }"/>
<img onclick="WdatePicker({el:$dp.$('d12')})" src="../js/skin/datePicker.gif" width="16" height="22" align="absmiddle"></td>
</tr>
<tr>
<td height="30"> 作者:</td>
<td height="30">
<input type="text" name="authorName" value="${book.author.authorName }"></td>
</tr>
<tr>
<td height="30"> 图书封面:</td>
<td height="30">
<input type="file" name="cover" value="${book.cover}"></td>
</tr>
<tr>
<td height="30"> 价格:</td>
<td height="30">
<input type="text" name="price" value="${book.price}"></td>
</tr>
<tr>
<td height="30"> 当当折扣:</td>
<td height="30">
<input type="text" name="dangPrice" value="${book.free }"></td>
</tr>
<tr>
<td height="30"> 内容简介:</td>
<td height="30"> <FCK:editor instanceName="content" width="95%" height="300" toolbarSet="Default">
<jsp:attribute name="value"><c:if test="${book.description!=null}">${book.description }</c:if><c:if test="${book.description==null}"> </c:if>
</jsp:attribute>
</FCK:editor></td>
</tr>
<tr>
<td></td>
<td><div align="left"><input onClick="doAddSubmit('../servlet/AddBookServlet')" style="width:40px;" name="s1" type="button" value="增加">
<input style="width:40px" onClick="doUpdateSubmit('../servlet/UpdateBookServlet')" name="s2" type="button" value="修改">
<input name="re" style="width:40px" type="reset" value="重写"></div></td>
</tr>
</table>
</form>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -