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

📄 bid.jsp

📁 JSP入门与提高.大量丰富的实例。
💻 JSP
字号:
<% 
String getLoginmessage = (String) session.getValue("loginSign");
   if(getLoginmessage!="OK"){
%>
<script language=javascript>
  window.location="../false.jsp"
</script>
<% 
}     
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>出价</title>
<link rel=stylesheet href="../style.css" type="text/css">
<script language="JavaScript">
function isNum(passedVal) {         
      if (passedVal == "") {            
      return false
      }         
      for (i=0; i<passedVal.length; i++) {                                    
      if (passedVal.charAt(i) < "0") {
            return false            
            }            
         if (passedVal.charAt(i) > "9") {               
         return false             
         }         
      }         
      return true      
   }      
   
function checkrcchok() {
      if (document.frm_bid.sprice.value=="")	{
	alert("起始价不能为空!请填写!");
	document.frm_bid.sprice.focus();
      return false;
      }
      if (isNum(document.frm_bid.sprice.value)==false)	{
         alert("起始价格式不对,请重新填写!");
         document.frm_bid.sprice.focus();
      return false;
      }
      var ss1=document.frm_bid.nprice.value
      var ss0=document.frm_bid.sprice.value
      if (ss1>=ss0){
	alert("出价不能低于参考价!请重新填写!");
	document.frm_bid.sprice.focus();
      return false;
      }
      
      if (document.frm_bid.amount.value=="")	{
	alert("数量不能为空!请填写!");
	document.frm_bid.amount.focus();
      return false;
      }
      if (isNum(document.frm_bid.amount.value)==false)	{
         alert("数量格式不对,请重新填写!");
         document.frm_bid.amount.focus();
      return false;
      }	
      var nn1=document.frm_bid.numb.value
      var nn0=document.frm_bid.amount.value
      if (nn0>nn1){
	alert("数量不能高于总量!请重新填写!");
	document.frm_bid.amount.focus();
      return false;
      }	
}
	
</script>
</head>

<body>
<%
   String username = (String) session.getValue("username");
   String product_id = (String) session.getValue("pid");
   String nprice = (String) session.getValue("nprice");
   String numb = (String) session.getValue("amount");
%>
<form method="POST" name="frm_bid" action="ok_bid.jsp"  onsubmit="return checkrcchok();">
  <input type="hidden" name="name" value="<%= username %>">
  <input type="hidden" name="product_id" value="<%= product_id %>">
  <input type="hidden" name="nprice" value="<%= nprice %>">
  <input type="hidden" name="numb" value="<%= numb %>">
  
<table width="500" border="0" cellspacing="0" cellpadding="0">
  <tr valign="top" align="center"> 
    <td> 
      <p><h4>出价</h4> 
      <table border="0" width="51%">
        <tr>
          <td width="47%" align="right" >参考价</td>
          <td width="4%" ></td>
          <td width="49%"><font color="red"><%= nprice %>元</font></td> 
        </tr>
        <tr> 
          <td width="47%" align="right" >起始价(元)</td>
          <td width="4%" ></td>
          <td width="49%" > 
            <input type="text" name="sprice" size="20">
          </td>
        </tr>
        <tr> 
          <td width="47%" align="right" >数量</td>
          <td width="4%" ></td>
          <td width="49%" > 
            <input type="text" name="amount" size="20">
          </td>
        </tr>
        <tr> 
          <td width="47%" align="right" >留言</td>
          <td width="4%" ></td>
          <td width="49%" > 
            <p> 
              <textarea rows="8" name="say" cols="26"></textarea>
          </td>
        </tr>
      </table>
      
        <p><input type="submit" value="确定"  name="B1" class="buttonface">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
        <input type="reset" value="取消" name="B2" class="buttonface"></p>
        <br>
        <br>
      </p>
    </td>
  </tr>
</table>
</form>
</body>
</html>

⌨️ 快捷键说明

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