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

📄 showinfo.asp

📁 大家好
💻 ASP
字号:
<%@ Language=VBScript %>
<html>
<head>
<link rel="stylesheet" href="../html/3508.css">
<script language=JavaScript >
 
 function IsEMail(mail)
{
     strMatch = /([^@]+\@[^@]+\.+[^@])/;
	 if(mail.match(strMatch))
	 {
	   return true;
	 }
	 else
	 {
	   alert("请输入正确的电子邮件地址!");
	   return false;
	 }
}
function HasBug(strtest)
{
   var str = new String(strtest)
   strMatch = /["']/;
   if(str.length!=0 && str.search(strMatch)!=-1)
     return true;
   else
     return false;
}


function checkvalid(price,desc,email,contact,pname)
{
      if (pname.length>15 || pname.length<=0){
      	alert("商品名称不得超过15字且不能为空,请检查!");
      	return false;
      }
      if (email.length>30){
      	alert("电子邮件长度超过允许范围,请检查!");
      	return false;
      }
      if (desc.length>100 || desc.length<=0){
      	alert("广告内容不得为空或超过100字,请检查!");
      	return false;
      }
      if (price.length>15 || price.length<=0){
      	alert("价格描述不得超过15字,请检查!");
      	return false;
      }
      if (contact.length>40){
      	alert("联系方式不得超过40字,请检查!");
      	return false;
      }
      if(email!="" && !IsEMail(email))
		 {
		 
		 return false;
		 }           
     
	  else
	     {
	     if(HasBug(desc) || HasBug(email) || HasBug(contact) || HasBug(pname))
	     {
	       alert("输入了不规范字符,如:\" \'");
	       return false;
	     }
		 //document.forms["form1"].action="savebuyinfo.asp";
         	 //document.forms["form1"].submit();
		 return true;
		
		 }
	
}

function checkvalid2(price,desc,email,contact,pname,cname2)
{
      if (pname.length>15 || pname.length<=0){
      	alert("商品名称不得超过15字且不成为空,请检查!");
      	return false;
      }
      if (email.length>30){
      	alert("电子邮件长度超过允许范围,请检查!");
      	return false;
      }
      if (desc.length>150){
      	alert("广告内容不得超过150字,请检查!");
      	return false;
      }
      if (price.length>15){
      	alert("价格描述不得超过15字,请检查!");
      	return false;
      }
      if (contact.length>40){
      	alert("联系方式不得超过40字,请检查!");
      	return false;
      }
      if(email!="" && !IsEMail(email))
		 {
		 
		 return false;
		 }           
      else if (cname2==""){
      	  alert ("请输入所在城市名称!");
      	  return false;
          }
	  else
	     {
	     if(HasBug(desc) || HasBug(email) || HasBug(contact) || HasBug(pname))
	     {
	       alert("输入了不规范字符,如:\" \'");
	       return false;
	     }
		 //document.forms["form1"].action="savebuyinfo.asp";
         	 //document.forms["form1"].submit();
		 return true;
		
		 }
}
</script>
<style type="text/css">
<!--
.botton {  font-size: 12px; color: #000000; background-color: #FFFFE8}
.red {  color: #FF0000}
.green {  color: #006600}
-->
</style>
</head>
<body background="../images/bg1.gif">
<table width="740" border="0" cellspacing="0" cellpadding="0" align="center" height="40">
  <tr> 
    <td width="162" height="39" align="center"><img src="../images/newzhao1zhao.gif" width="140" height="50"></td>
    <td width="578" valign="bottom" height="39" align="right"> 
      <table width="480" border="1" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF" bgcolor="#CCCCFF" cellpadding="0" cellspacing="0" height="22">
        <tr align="center"> 
          <td width="75" bordercolorlight="#FFFFFF" bordercolordark="#000000" align="center" height="18"><a href="../html/navigator.asp">本站导航</a></td>
          <td width="75" bordercolorlight="#FFFFFF" bordercolordark="#000000" align="center" height="18"> 
            <a href="search.asp">二手市场</a></td>
          <td width="75" bordercolorlight="#FFFFFF" bordercolordark="#000000" align="center" height="18"><a href="../chat/default.asp">供求信息</a></td>
          <td width="75" bordercolorlight="#FFFFFF" bordercolordark="#000000" align="center" height="18"><a href="../news/index.asp">精品生活</a></td>
          <td width="75" bordercolorlight="#FFFFFF" bordercolordark="#000000" align="center" height="18"> 
            <a href="../lovelife/default.asp">我爱生活</a></td>
          <td width="75" bordercolorlight="#FFFFFF" bordercolordark="#000000" align="center" height="18"><a href="../xhtj/index.asp">笑话天地</a></td>
          <td width="75" bordercolorlight="#FFFFFF" bordercolordark="#000000" align="center" height="18"><a href="../diaocha1/diaocha1.asp">调查生活</a></td>
          <td width="75" bordercolorlight="#FFFFFF" bordercolordark="#000000" align="center" height="18"><a href="../club/Default.asp">生活社区</a></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr> 
    <td colspan="2" height="1" bgcolor="006600"></td>
  </tr>
</table>
<table width="740" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFCCFF">
  <tr> 
    <td height="19" width="483">【本站导航】<a href="../default.asp">首页</a> &gt;&gt; 
      二手信息</td>
    <td height="19" width="93"><a href="search.asp">查询登录信息</a></td>
    <td width="83"> <a href="selcat.asp?itype=求" >登记购买信息</a></td>
    <td width="81"><a href="selcat.asp?itype=供" >登记销售信息</a></td>
  </tr>
</table>
<% 
 'Response.write(Request.form("radio1"))
 %> <%
if trim(request("cname"))="其它" then
response.write "<form name=form1 action= ./saveinfo.asp?mjj=0 onsubmit='"&"return checkvalid2(price.value,desc.value,email.value,contact.value,pname.value,cname2.value)"&"' method=post >"
%> 
<table width="531" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td width="110" align="right" class="green">【所在城市】</td>
    <td width="421"> 
      <input type=text name=cname2 class="botton" size="16" maxlength="10">
    </td>
</tr>
</table>
<%else%>
<form name=form1 action= ./saveinfo.asp?mjj=1 onsubmit="return checkvalid(price.value,desc.value,email.value,contact.value,pname.value)" method=post >
<%end if%> 
  <table width="530" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>
      <td width="111" align="right" class="green">【商品名称】</td>
      <td width="419"> 
        <input name= pname class="botton" maxlength="15" size="20" >
      </td>
  </tr>
  <tr>
      <td width="111" align="right" class="green">【价格】</td>
      <td width="419"> 
        <input name = price class="botton" maxlength="15" size="24" >
      </td>
  </tr>
  <tr>
      <td width="111" align="right" class="green" valign="top">【物品描述】</td>
      <td width="419"> 
        <textarea cols=50 name=desc rows=6 class="botton"></textarea>
      </td>
  </tr>
  <tr>
      <td width="111" align="right" class="green">【E_MAIL】</td>
      <td width="419"> 
        <input name=email class="botton" size="30" maxlength="30" >
      </td>
  </tr>
  <tr>
      <td width="111" align="right" class="green">【联系方式】</td>
      <td width="419"> 
        <input name=contact class="botton" size="50" maxlength="40" >
        <input type=hidden name=cname value="<%=request("cname")%>">
      </td>
  </tr>
    <tr align="center" valign="bottom"> 
      <td colspan="2" height="60"> 
        <input type = "submit" onSubmit="checkvalid" value= "提交" name= "submit1" class="botton">
        <input type="reset" name="Reset" value="重置" class="botton">
        <% 'the hidden form to carry the catogary info 
       Response.Write("<input type =hidden name = cat value=" & Request.Form("radio1") & ">")
       response.write("<input type= hidden name= itype value="& request("itype")& ">")
    %> </td>
</tr>
</table>
<!--#include file="../include/end.htm" -->
 </form>
</body>
</html>

⌨️ 快捷键说明

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