| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 729 人关注过本帖
标题:我的一个页面代码出错请指点下好吗?
只看楼主 加入收藏
srg778
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-9-9
收藏
 问题点数:0 回复次数:5 
我的一个页面代码出错请指点下好吗?
表单提交时提示出错了

<%
work=Request("work")
IF work="add" Then
   set rs=server.createobject("adodb.recordset")
   sql="select * from Dingdan"
   rs.open sql,conn,3,3
   rs.addnew                                         '添加记录到数据表末端
    rs("a1")        =       Request("a1")
    rs("a2")        =       Request("a2")
    rs("a3")          =       Request("a3")
    rs("a4")        =       Request("a4")
    rs("a5")        =       Request("a5")
    rs("a6")        =       Request("a6")
    rs("a7")        =       Request("a7")
    rs("a8")        =       Request("a8")
    rs("a9")        =       Request("a9")
    rs("a10")        =       Request("a10")
    rs("a11")          =       Request("a11")
    rs("a12")        =       Request("a12")
    rs("a13")        =       Request("a13")
    rs("a14")        =       Request("a14")
    rs("a15")        =       Request("a15")
    rs("a16")        =       Request("a16")
    rs("a17")        =       Request("a17")
    rs("a18")        =       Request("a18")
    rs("a23")        =       Request("a23")
    rs("a24")        =       Request("a24")
    rs("a25")        =       Request("a25")
    rs("a26")        =       Request("a26")
    rs("a27")        =       Request("a27")
    
        rs.update                                         '更新数据表记录
        rs.close
        set rs=nothing
   Response.Write "<SCRIPT LANGUAGE='JavaScript'>"
   Response.Write "alert('恭喜您!\n 您的资料已经提交成功!');"
   Response.Write "window.location='service2.asp'"
   Response.Write "</SCRIPT>"
   end if
%>
                    <script LANGUAGE="JavaScript">
function check()
{
  if (document.theForm.a1.value=="")
     {
      alert("加*项不可为空!")
      document.theForm.a1.focus()
      document.theForm.a1.select()
      return
     }
  if (document.theForm.a2.value=="")
     {
      alert("加*项不可为空!")
      document.theForm.a2.focus()
      document.theForm.a2.select()        
      return
     }
  if (document.theForm.a3.value=="")
     {
      alert("加*项不可为空!")
      document.theForm.a3.focus()
      document.theForm.a3.select()        
      return
     }
  if (document.theForm.a4.value=="")
     {
      alert("加*项不可为空!")
      document.theForm.a4.focus()
      document.theForm.a4.select()        
      return
     }
  if (document.theForm.a5.value=="")
     {
      alert("加*项不可为空!")
      document.theForm.a5.focus()
      document.theForm.a5.select()        
      return
     }
       if (document.theForm.a6.value=="")
     {
      alert("加*项不可为空!")
      document.theForm.a6.focus()
      document.theForm.a6.select()        
      return
     }
  if (document.theForm.a7.value=="")
     {
      alert("加*项不可为空!")
      document.theForm.a7.focus()
      document.theForm.a7.select()        
      return
     }
  if (document.theForm.a8.value=="")
     {
      alert("加*项不可为空!")
      document.theForm.a8.focus()
      document.theForm.a8.select()        
      return
     }
     document.theForm.submit()
}
              </SCRIPT>
                    <form name="theForm" method="post" action="?work=add">
                      <table width="95%" border="0" cellspacing="0" cellpadding="3">
                        <tr>
                          <td height="20" colspan="4">&nbsp;</td>
                        </tr>
                        <tr>
                          <td height="20" align="right"><div align="left">公司名称:</div></td>
                          <td><div align="left">
                            <input name="a1" type="text"  id="a1" size=20>
                          </div></td>
                          <td><div align="left">业务类型:</div></td>
                          <td><div align="left">
                            <select name="a23">
                              <%
set rs=server.createobject("adodb.recordset")
sql="select * from Lb_name"
rs.open sql,conn,1,1
do while Not rs.eof
%>
                                <option value="<%=rs("tb")%>"><%=rs("tb")%></option>
                                <%
rs.movenext
Loop
rs.close
set rs=nothing
%>
                            </select>
                          </div></td>
                        </tr>
                        <tr>
                          <td height="20" align="right"><div align="left">联 系 人:</div></td>
                          <td><div align="left">
                            <input type="text" name="a3" size=20 >
                          </div></td>
                          <td><div align="left">联系地址:</div></td>
                          <td><div align="left">
                            <input name="a4" type="text"  id="a4" size=20>
                          </div></td>
                        </tr>
                        <tr>
                          <td align="right"><div align="left">移动电话:</div></td>
                          <td><div align="left">
                            <input name="a2" type="text"  id="a2" size=20>
                          </div></td>
                          <td><div align="left">电子邮件:</div></td>
                          <td><div align="left">
                            <input name="a6" type="text" id="a6" size=20>
                          </div></td>
                        </tr>
                        <tr>
                          <td height="20" align="right"><div align="left">传真号码:</div></td>
                          <td><div align="left">
                            <input type="text" name="a7" size=20 >
                          </div></td>
                          <td height="20"><div align="left">联系电话:</div></td>
                          <td><div align="left">
                            <input type="text" name="a5" size=20 >
                          </div></td>
                        </tr>
                        <tr>
                          <td height="24" align="right"><div align="left">起运地:</div></td>
                          <td><div align="left">
                            <input type="text" name="a8" size=20 >
                          </div></td>
                          <td><div align="left">运输方式;</div></td>
                          <td nowrap>
                                <div align="left">
                                  <select name="a24" id="a24">
                                      <option selected>航空</option>
                                      <option>铁路</option>
                                      <option>公路</option>
                                      <option>海运</option>
                                  </select>
                                </div></td></tr>
                        <tr>
                          <td height="24" align="right"><div align="left">目的地:</div></td>
                          <td><div align="left">
                            <input type="text" name="a10" size=20 >
                          </div></td>
                          <td><div align="left">货物保险:</div></td>
                          <td><div align="left">
                                  <input name="a9" type="radio" value="零担" checked>
                              零担
                              <input name="a92" type="text" size="10">
                          </div></td>
                        </tr>
                        <tr>
                          <td height="24" align="right"><div align="left">发货时间:</div></td>
                          <td><div align="left">
                            <input type="text" name="a11" size=20 >
                          </div></td>
                          <td><div align="left">货物规格:</div></td>
                          <td nowrap>                            <div align="left">
                              <select name="a26" id="select3">
                                  <option>3吨以上</option>
                                  <option selected>轻货</option>
                                  <option>整车</option>
                              </select>
                              <input name="a26" type="text" id="a26" size="5">
                          </div></td>
                        </tr>
                        <tr>
                          <td height="24" align="right"><div align="left">货物名称:</div></td>
                          <td><div align="left">
                            <input type="text" name="a13" size=20 >
                          </div></td>
                          <td><div align="left">货物性质:</div></td>
                          <td>
                              <div align="left">
                                <select name="a27" id="a27">
                                      <option selected>易碎品</option>
                                      <option>普通物品</option>
                                      <option>贵重物品</option>
                                      <option>其它物品</option>
                                </select>
                              </div></td>
                        </tr>
                        <tr>
                          <td height="24" align="right" valign="top"><p align="left">货物重量:</p>
                            </td>
                          <td><p align="left">
                            <input type="text" name="a14" size=20 >
                            <input name="a14" type="text" id="a14" value="公斤" size="5">
                          </p>
                            </td>
                          <td><div align="left">货物体积:</div></td>
                          <td><p align="left">
                            <input name="a25" type="text" id="a25" size=20 >
                          </p>
                            </td>
                        </tr>
                        <tr>
                          <td height="24" align="right" valign="top"><div align="left">结算方式:</div></td>
                          <td colspan="3"><div align="left">
                    <input name="a15" type="radio" value="发货付费" checked>
                发货付费
                  <input type="radio" name="a15" value="发货付部分费">
                发货付部分费
                <input type="radio" name="a15" value="货到付费">
                货到付费</div></td>
                        </tr>
                        <tr>
                          <td height="24" align="right" valign="top"><p align="left">托运方式:</p>
                            </td>
                          <td colspan="3"><p align="left">
                    <input name="a16" type="radio" value="常温" checked>
                常温 
                  <input name="a16" type="radio" value="低温">
                低温 
                <input name="a16" type="radio" value="一般">
                一般 
                <input name="a16" type="radio" value="箱型">
                箱型 </p>
                            </td>
                        </tr>
                        <tr>
                          <td height="24" align="right" valign="top"><div align="left">其它要求:</div></td>
                          <td colspan="3">
                                  <div align="left">
                                    <textarea name="a17" cols="40" rows="5"></textarea>
                                  </div></td></tr>
                        <tr>
                          <td height="24" align="right" valign="top"><div align="left">备  注:</div></td>
                          <td colspan="3">
                              <div align="left">
                                <textarea name="a18" cols="40" rows="5"></textarea>
                            </div></td></tr>
                        <tr>
                          <td height="24" align="right" valign="top">&nbsp;</td>
                          <td><input type="button" name="Submit2" value="提交" class="input" onClick="check()"></td>
                          <td><input type="reset" name="Submit3" value="重填" class="input"></td>
搜索更多相关主题的帖子: 页面 代码 
2008-09-09 12:32
hmhz
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:30
帖 子:1890
专家分:503
注 册:2006-12-17
收藏
得分:0 
return 要写成 return false;

其他好象没有错吧,只能说程序写的太垃圾了

html,JS,asp 都需要优化

[[it] 本帖最后由 hmhz 于 2008-9-9 12:55 编辑 [/it]]

[编程论坛] ASP超级群:49158383  敲门暗号:ASP编程
龍艺博客 http://www.
2008-09-09 12:53
srg778
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-9-9
收藏
得分:0 
没办法啊!我是刚学ASP没多久的啊
2008-09-09 13:06
srg778
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-9-9
收藏
得分:0 
回复 2# hmhz 的帖子
没办法啊!我是刚学ASP没多久的啊.还请你多多指教啊!
2008-09-09 13:06
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
总得说清楚“出错”有什么提示吧。
2008-09-09 13:07
srg778
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-9-9
收藏
得分:0 
回复 5# multiple1902 的帖子
还是不行啊!提示以下错误信息啊!还请你指点下行吗?在此谢过了!
类型不匹配。

\wwwroot\service2.asp, line 92
2008-09-09 13:11
快速回复:我的一个页面代码出错请指点下好吗?
数据加载中...
 
   



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

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