⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 post.jsp

📁 jsp的技术教程
💻 JSP
字号:
<%@ include file="head.inc"%>
<%if(session.getAttribute("username")==null){
	response.sendRedirect("../member/login.jsp?url="+request.getRequestURI());
}
%>

<jsp:useBean id='clock' scope='page' class='dates.JspCalendar' type="dates.JspCalendar" />      
             
<TABLE border=0 cellPadding=0 cellSpacing=0 width=760 align="center">
  <TBODY>
  <tr><td align="left" height=25><%if(session.getAttribute("username")!=null){out.println(session.getAttribute("username"));}%>  当前位置:<a href="../index.jsp">首页</a> -&gt; <a href="index.jsp">张贴</a> -&gt; 张贴  </td>
 <%@ include file="../member/date.inc"%>
  </tr>
  <TR bgColor=#3399ff>
    <TD height=1 colspan="2"><IMG height=1 src="images/spacer.gif" 
  width=16></TD></TR>
  <tr><td height=10 colspan="2"><IMG height=1 src="images/spacer.gif" 
  width=16></td></tr>
  </TBODY></TABLE>

  <table align="center" border="0" width="760" cellspacing="0" cellpadding="0" height="355">                  
	<tr>                  
		<td width="150" height="355" valign="top">                  

		</td>                  
		<td width="10" height="100%"></td>
		<td width="1" height="100%" bgcolor="#3399ff"></td>
		<td width="10" height="100%"></td>
		<td width="589" height="331" valign="top" background="images/bg1.gif">                       
        <table border="0" width="100%" cellspacing="0" cellpadding="0" height="307">                  
          <tr>                  
            <td width="100%" height="20" bgcolor="#3399ff">&nbsp;<font color="#ffffff">张贴</font>
			</td>
		  </tr>

		  <tr>
			<td>
				<form name="form1" method="post" action="post_ok.jsp">
				  <table width="100%" border="0" cellspacing="0" cellpadding="0">
				  <tr><td colspan="3" height="20"></td></tr>
					<tr> 
					  <td align="right" width="120" valign="top">说明:</td>
					  <td width="20">&nbsp;</td>
					  <td width="450">
						<ul type="square">
							<li>不支持HTML,请用文本格式。所有输入的HTML标记,都会被还原!</li>
							
							<li>全部内容必须填</li>
							
						</ul>
					  </td>
					</tr>
					<tr> 
					  <td align="right">书名:</td>
					  <td width="20">*</td>
					  <td width="500"> 
						<input type="text" name="name" size="64" value="">
					  </td>
					</tr>
					<tr> 
					  <td align="right">作者:</td>
					  <td width="20">*</td>
					  <td width="500"> 
						<input type="text" name="author" size="64" value="">
					  </td>
					</tr>
					<tr> 
					  <td align="right">语言:</td>
					<td width="20">*</td>
					  <td width="500"> 
						 <input type="radio" name="language" value="1" checked>中文 
         				 <input type="radio" name="language" value="2">英文
					  </td>
					</tr>
					<tr> 
					  <td align="right">类别:</td>
					<td width="20">*</td>
					  <td width="500"> 
						 <input type="radio" name="category" value="1" checked>计算机类 
         				<input type="radio" name="category" value="2" >英语类
						<input type="radio" name="category" value="3" >其他类 
					  </td>
					</tr>
					<tr> 
					  <td align="right" valign="top">内容简介:</td>
					  <td width="20" valign="top">*</td>
					  <td>
						<textarea name="content" cols="64" rows="5"></textarea>
					  </td>
					</tr>
					<tr> 
					  <td align="right">推荐程度:</td>
					  <td width="20">*</td>
					  <td width="500"> 
						<input type="radio" name="commend" value="1">好
         				 <input type="radio" name="commend" value="2">较好
						 <input type="radio" name="commend" value="3"  checked>一般
         				 <input type="radio" name="commend" value="4">较差
						 <input type="radio" name="commend" value="5">差

					  </td>
					</tr>
					<tr> 
					  <td align="right">出版社名称:</td>
					  <td width="20">*</td>
					  <td width="500"> 
						<input type="text" name="publish_name" size="64" value="">
					  </td>
					</tr>
					<tr> 
					  <td align="right">出版社地址:</td>
					 <td width="20">*</td>
					  <td width="500"> 
						<input type="text" name="publish_address" size="64" value="">
					  </td>
					</tr>
					<tr> 
					  <td align="right">是否配有光盘:</td>
					  <td width="20">*</td>
					  <td width="500"> 
						 <input type="radio" name="cdrom" value="1" checked>有
         				 <input type="radio" name="cdrom" value="0">没有
					  </td>
					</tr>
					<tr> 
					  <td align="right">价格:</td>
					 <td width="20">*</td>
					  <td width="500"> 
						<input type="text" name="price1" size="4" value="">元
						<input type="text" name="price2" size="4" value="">角
					  </td>
					</tr>
					
					<tr> 
					  <td align="right">是否是特价书:</td>
					  <td width="20">*</td>
					  <td width="500"> 
						 <input type="radio" name="good_price" value="1" checked>是
         				 <input type="radio" name="good_price" value="0">否
					  </td>
					</tr>
					<tr> 
					  <td align="right">库存量:</td>
					 <td width="20">*</td>
					  <td width="500"> 
						<input type="text" name="book_number" size="64" value="">
					  </td>
					</tr>
					<tr> 
					  <td align="right">&nbsp;</td>
					  <td width="20">&nbsp;</td>
					  <td align="right">
						<input type="button" name="post" value="张贴" onclick="sub()">
					  </td>
					</tr>
				  </table>
				</form>
<%//}%>
			</td>
		  </tr>
        </table>                  

		<script language="javascript">
		function sub()
		{
			if(document.form1.name.value=="")
			{
				window.alert("请输入书名!");
				document.form1.name.focus();
				return false;
			}
			if(document.form1.author.value=="")
			{
				window.alert("请输入作者姓名!");
				document.form1.author.focus();
				return false;
			}
			if(document.form1.content.value=="")
			{
				window.alert("请输入内容简介!");
				document.form1.content.focus();
				return false;
			}
			if(document.form1.publish_name.value=="")
			{
				window.alert("请输入出版社名称!");
				document.form1.publish_name.focus();
				return false;
			}
			if(document.form1.publish_address.value=="")
			{
				window.alert("请输入出版社地址!");
				document.form1.publish_address.focus();
				return false;
			}
			
			if(document.form1.price1.value=="")
			{
				window.alert("请输入价格!");
				document.form1.price1.focus();
				return false;
			}
			
			if(isNaN(parseInt(document.form1.price1.value))||document.form1.price1.value<0)
			{
				window.alert("请输入正确的价格!");
				document.form1.price1.focus();
				return false;
			}
			if(document.form1.price2.value=="")
			{
				window.alert("请输入价格!");
				document.form1.price2.focus();
				return false;
			}
			if(isNaN(parseInt(document.form1.price2.value))||document.form1.price2.value>9||document.form1.price2.value<0)
			{
				window.alert("请输入正确的价格!");
				document.form1.price2.focus();
				return false;
			}
			if(document.form1.book_number.value=="")
			{
				window.alert("请输入库存量!");
				document.form1.book_number.focus();
				return false;
			}
		
			if(isNaN(parseInt(document.form1.book_number.value))||document.form1.book_number.value<0)
			{
				window.alert("请输入正确的库存量!");
				document.form1.book_number.focus();
				return false;
			}
			document.form1.submit();
		}
		</script>

        </td>
    </tr>

  </table>
<%@ include file="footer.inc"%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -