| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 744 人关注过本帖
标题:[推荐][求助]
只看楼主 加入收藏
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5810
专家分:118
注 册:2005-4-7
收藏
得分:0 
以下是引用she151在2005-6-7 15:23:53的发言: <form action="" method="post" onSubmit="chkform(this)"> //或者<form name=formname action="" method="post" onSubmit="chkform(formname)"> action里面填写你要提交的页面 <table width="495" height="278" border="0" cellpadding="3" cellspacing="0" bgcolor="#CCCCCC"> <tr bgcolor="#FFFFFF"> <td width="110" align="right">您的姓名:</td> <td width="373"><input name="GuestName" type="text" id="GuestName" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" size="12"> <font color="#FF0000"> *</font></td> </tr> <tr bgcolor="#FFFFFF"> <td align="right">公司名称:</td> <td><input name="CompanyName" type="text" id="CompanyName" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" size="30"> <font color="#FF0000">*</font></td> </tr> <tr bgcolor="#FFFFFF"> <td align="right">咨询主题:</td> <td><input name="GuestTitle" type="text" id="GuestTitle" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" size="30"> <font color="#FF0000"> *</font></td> </tr> <tr bgcolor="#FFFFFF"> <td align="right">联系电话:</td> <td><input name="GuestTel" type="text" id="GuestTel" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" size="20"> <font color="#FF0000"> *</font></td> </tr> <tr bgcolor="#FFFFFF"> <td align="right">手 机:</td> <td><input name="GuestMobil" type="text" id="GuestMobil" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #?瀱?潳楬d????昀?ぢ9慡?朮晩??牔浩?摩猨牴偉摁牤??师?000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" size="20"> </td> </tr> <tr bgcolor="#FFFFFF"> <td align="right">联系地址:</td> <td><input name="GuestAddress" type="text" id="GuestAddress" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" size="40"></td> </tr> <tr bgcolor="#FFFFFF"> <td align="right">电子邮箱:</td> <td><input name="GuestEmail" type="text" id="GuestEmail" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" size="20"> <font color="#FF0000"> *</font></td> </tr> <tr bgcolor="#FFFFFF"> <td align="right">咨询内容:</td> <td><textarea name="GuestContent" cols="55" rows="7" id="GuestContent" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid"></textarea> <font color="#FF0000"> *</font></td> </tr> <tr align="center" bgcolor="#FFFFFF"> <td height="45" colspan="2"><input type="submit" name="Submit2" value="提交咨询"> </td> </tr> </table> </form> <!--#include file="Conn.asp" --> <!--#include file="Admin/Inc/Const.asp" --> <% Set Rs=server.CreateObject("adodb.recordset") Rs.activeconnection=conn If Trim(Request("action"))="add" Then GuestName=Replace(Trim(Request("GuestName")),"'","") If Trim(GuestName)="" Then Call CLoseConn(Conn) Msgstr="姓名不能为空" msg(Msgstr) Back Response.end End if CompanyName=Replace(Trim(Request("CompanyName")),"'","") GuestTitle=Replace(Trim(Request("GuestTitle")),"'","") GuestTel=Replace(Trim(Request("GuestTel")),"'","") If GuestTel="" Then Call CLoseConn(Conn) Msgstr="联系电话不能为空" msg(Msgstr) Back Response.end End if GuestMobil=Replace(Trim(Request("GuestMobil")),"'","") GuestAddress=Replace(Trim(Request("GuestAddress")),"'","") GuestEmail=Replace(Trim(Request("GuestEmail")),"'","") GuestContent=Replace(Replace(Request("GuestContent"),"'",""),vbcrlf,"<br>") If Trim(GuestContent)="" Then Call CLoseConn(Conn) Msgstr="留言内容不能为空" msg(Msgstr) Back Response.end End if sql="insert into TbGuest(GuestName,CompanyName,GuestTitle,GuestTel,GuestMobil,GuestAddress,GuestEmail,GuestContent) " Sql=Sql&" values('"&GuestName&"','"&CompanyName&"','"&GuestTitle&"','"&_ GuestTel&"','"&GuestMobil&"','"&GuestAddress&"','"&GuestEmail&"','"&GuestContent&"')" Conn.Execute(Sql) Call CloseConn(Conn) Msgstr="新增成功" Msg(Msgstr) Redirect("inqu.asp") Response.end End if %> <script language="JavaScript"> function chkform(formobj){ if(formobj.GuestName.value.replace(/^\s*/,'').replace(/\s*$/,'')==""){ alert("姓名不能为空") formobj.GuestName.focus() return false } if(formobj.GuestTel.value.replace(/^\s*/,'').replace(/\s*$/,'')==""){ alert("联系电话不能为空") formobj.GuestTel.focus() return false } if(formobj.GuestContent.value.replace(/^\s*/,'').replace(/\s*$/,'')==""){ alert("信的内容不能为空") formobj.GuestContent.focus() return false } return true } </script> 为什么表单提交时都没有响应呢

2005-06-08 08:50
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5810
专家分:118
注 册:2005-4-7
收藏
得分:0 

<form action="" method="post" onSubmit="chkform(this)"> //或者<form name=formname action="" method="post" onSubmit="chkform(formname)"> action里面填写要提交的页面 <table width="495" height="278" border="0" cellpadding="3" cellspacing="0" bgcolor="#CCCCCC"> <tr bgcolor="#FFFFFF"> <td width="110" align="right">您的姓名:</td> <td width="373"><input name="GuestName" type="text" id="GuestName" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" size="12"> <font color="#FF0000"> *</font></td> </tr> <tr bgcolor="#FFFFFF"> <td align="right">公司名称:</td> <td><input name="CompanyName" type="text" id="CompanyName" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" size="30"> <font color="#FF0000">*</font></td> </tr> <tr bgcolor="#FFFFFF"> <td align="right">咨询主题:</td> <td><input name="GuestTitle" type="text" id="GuestTitle" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" size="30"> <font color="#FF0000"> *</font></td> </tr> <tr bgcolor="#FFFFFF"> <td align="right">联系电话:</td> <td><input name="GuestTel" type="text" id="GuestTel" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" size="20"> <font color="#FF0000"> *</font></td> </tr> <tr bgcolor="#FFFFFF"> <td align="right">手 机:</td> <td><input name="GuestMobil" type="text" id="GuestMobil" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #?瀱?潳楬d????昀?ぢ9慡?朮晩??牔浩?摩猨牴偉摁牤??师?000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" size="20"> </td> </tr> <tr bgcolor="#FFFFFF"> <td align="right">联系地址:</td> <td><input name="GuestAddress" type="text" id="GuestAddress" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" size="40"></td> </tr> <tr bgcolor="#FFFFFF"> <td align="right">电子邮箱:</td> <td><input name="GuestEmail" type="text" id="GuestEmail" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" size="20"> <font color="#FF0000"> *</font></td> </tr> <tr bgcolor="#FFFFFF"> <td align="right">咨询内容:</td> <td><textarea name="GuestContent" cols="55" rows="7" id="GuestContent" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid"></textarea> <font color="#FF0000"> *</font></td> </tr> <tr align="center" bgcolor="#FFFFFF"> <td height="45" colspan="2"><input type="submit" name="Submit2" value="提交咨询"> </td> </tr> </table>

</form>

<!--#include file="Conn.asp" --> <!--#include file="Admin/Inc/Const.asp" --> <% Set Rs=server.CreateObject("adodb.recordset") Rs.activeconnection=conn If Trim(Request("action"))="add" Then GuestName=Replace(Trim(Request("GuestName")),"'","") If Trim(GuestName)="" Then Call CLoseConn(Conn) Msgstr="姓名不能为空" msg(Msgstr) Back Response.end End if CompanyName=Replace(Trim(Request("CompanyName")),"'","") GuestTitle=Replace(Trim(Request("GuestTitle")),"'","") GuestTel=Replace(Trim(Request("GuestTel")),"'","") If GuestTel="" Then Call CLoseConn(Conn) Msgstr="联系电话不能为空" msg(Msgstr) Back Response.end End if GuestMobil=Replace(Trim(Request("GuestMobil")),"'","") GuestAddress=Replace(Trim(Request("GuestAddress")),"'","") GuestEmail=Replace(Trim(Request("GuestEmail")),"'","") GuestContent=Replace(Replace(Request("GuestContent"),"'",""),vbcrlf,"<br>") If Trim(GuestContent)="" Then Call CLoseConn(Conn) Msgstr="留言内容不能为空" msg(Msgstr) Back Response.end End if sql="insert into TbGuest(GuestName,CompanyName,GuestTitle,GuestTel,GuestMobil,GuestAddress,GuestEmail,GuestContent) " Sql=Sql&" values('"&GuestName&"','"&CompanyName&"','"&GuestTitle&"','"&_ GuestTel&"','"&GuestMobil&"','"&GuestAddress&"','"&GuestEmail&"','"&GuestContent&"')" Conn.Execute(Sql) Call CloseConn(Conn) Msgstr="新增成功" Msg(Msgstr) Redirect("inqu.asp") Response.end End if %> <script language="JavaScript"> function chkform(formobj){ if(formobj.GuestName.value.replace(/^\s*/,'').replace(/\s*$/,'')==""){ alert("姓名不能为空") formobj.GuestName.focus() return false } if(formobj.GuestTel.value.replace(/^\s*/,'').replace(/\s*$/,'')==""){ alert("联系电话不能为空") formobj.GuestTel.focus() return false } if(formobj.GuestContent.value.replace(/^\s*/,'').replace(/\s*$/,'')==""){ alert("信的内容不能为空") formobj.GuestContent.focus() return false } return true } </script>


2005-06-08 08:59
longyu
Rank: 1
等 级:新手上路
帖 子:38
专家分:0
注 册:2005-6-6
收藏
得分:0 
没有表单怎么提交呀!晕死了!

2005-06-08 17:17
she151
Rank: 1
等 级:新手上路
帖 子:38
专家分:0
注 册:2005-6-7
收藏
得分:0 
内部管理文件——>【规章制度】 【工作制度】 收费标准——> 【地籍】 【用地】 【地矿】 办事结果公布--> 【土地矿产规划】 像这样的链接要怎么判断啊!!!!
2005-06-09 09:34
she151
Rank: 1
等 级:新手上路
帖 子:38
专家分:0
注 册:2005-6-7
收藏
得分:0 
内部管理文件——>【规章制度】 【工作制度】 收费标准——> 【地籍】 【用地】 【地矿】 办事结果公布--> 【土地矿产规划】 【矿产规划】 像这样的链接要怎么判断啊!!!!
2005-06-09 09:36
快速回复:[推荐][求助]
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025962 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved