?? showinfo.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> >>
二手信息</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 + -