| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 744 人关注过本帖
标题:[推荐][求助]
只看楼主 加入收藏
she151
Rank: 1
等 级:新手上路
帖 子:38
专家分:0
注 册:2005-6-7
收藏
 问题点数:0 回复次数:14 
[推荐][求助]
<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>


<!--#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-07 15:23
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5810
专家分:118
注 册:2005-4-7
收藏
得分:0 
你想要什么响应?
验证响应还是数据库操作成功以后响应?

2005-06-07 15:42
she151
Rank: 1
等 级:新手上路
帖 子:38
专家分:0
注 册:2005-6-7
收藏
得分:0 
就是判断后再提交啊
2005-06-07 16:43
she151
Rank: 1
等 级:新手上路
帖 子:38
专家分:0
注 册:2005-6-7
收藏
得分:0 
代码有错吗???
2005-06-07 16:45
cime63
Rank: 1
等 级:新手上路
帖 子:167
专家分:0
注 册:2004-8-9
收藏
得分:0 
你的代码不够简洁
需要简化

2005-06-07 16:51
she151
Rank: 1
等 级:新手上路
帖 子:38
专家分:0
注 册:2005-6-7
收藏
得分:0 
有好的代码吗??
2005-06-07 17:18
she151
Rank: 1
等 级:新手上路
帖 子:38
专家分:0
注 册:2005-6-7
收藏
得分:0 
楼上的,要怎么简化呢!有没有可以响应的代码。或帮我给一下。谢谢了
2005-06-07 17:25
she151
Rank: 1
等 级:新手上路
帖 子:38
专家分:0
注 册:2005-6-7
收藏
得分:0 
急急急!!!谁有类似www.bolongnet.com/qita/yt 中党建工作那样展开的代码啊!!!!!!!
2005-06-07 17:28
icmlfhah
Rank: 1
等 级:新手上路
帖 子:38
专家分:0
注 册:2005-6-5
收藏
得分:0 
提交没有响应的原因是,你根本就没有表单啊,
<form  name="表单名" action="提交页面.asp" method="post">内容:您的姓名 公司姓名……</form>
这样提交才行啊

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

[CODE] <form action="" method="post" onSubmit="chkform(this)"> <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> <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> [/CODE]


2005-06-08 08:46
快速回复:[推荐][求助]
数据加载中...
 
   



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

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