--------a.asp
<body>
<%SMT_TOP%>
<table>
<tr>
<td>
<table>
<tr>
<td>
<table>
<form name="form2" method="post" action="b.asp" onSubmit="return checkdata();">
<tr>
<td>求购信息</td>
</tr>
<tr>
<td>求购类别:
<select name="ypxxone_id">
<option value="" selected>请选择类别</option>
<%
sql11="select * from SMT_ypxxone order by SMT_date desc"
set rs11=server.createobject("ADODB.Recordset")
rs11.open sql11,conn,1,1
while not rs11.eof
%>
<option value="<%=rs11("SMT_ypxxone_id")%>"><%=rs11("SMT_ypxxone")%></option>
<%rs11.movenext
wend
rs11.Close()
%>
</select>
</font></td>
</tr>
<tr>
<td>
<div id="all" style="position:relative;>
<div id="50" style="position:absolute;visibility: hidden;">
<table>
<tr>
<%sql12="select * from SMT_ypxxtwo where SMT_ypxxone_id=50 order by SMT_date desc"
set rs12=Server.CreateObject("ADODB.Recordset")
rs12.open sql12,conn,1,1
if (rs12.eof and rs12.bof) then
response.write "<tr><td>暂无内容</td></tr>"
else
n=0 do while not rs12.eof
n=n+1
%>
<td><input name="checkbox_x" type="checkbox"value="<%=rs12("SMT_ypxxtwo_id")%>"><%=rs12("SMT_ypxxtwo")%></td>
<%if n mod 4=0 then response.write"</tr><tr align=center>"
rs12.movenext
loop
end if
rs12.close
set rs12=nothing
%>
</tr>
</table>
</div>
<div id="49" style="position:absolute; visibility: hidden">
<table>
<tr>
<%sql13="select * from SMT_ypxxtwo where SMT_ypxxone_id=49 order by SMT_date desc"
set rs13=Server.CreateObject("ADODB.Recordset")
rs13.open sql13,conn,1,1
if (rs13.eof and rs13.bof) then
response.write "<tr><td height=20 colspan=3>暂无内容</td></tr>"
else
n=0
do while not rs13.eof
n=n+1
%>
<td><input name="checkbox_x" type="checkbox" value="<%=rs13("SMT_ypxxtwo_id")%>"><%=rs13("SMT_ypxxtwo")%></td>
<%if n mod 4=0 then response.write"</tr><tr align=center>"
rs13.movenext
loop
end if
rs13.close
set rs13=nothing
%>
</tr>
</table>
</div>
</div>
</td>
</tr>
<tr>
<td>求购名称</td>
<td><input id="text" name="stitle" type="text" size="50" maxlength="48"></td>
</tr>
<tr>
<td>代理产品</td>
<td><input id="text" name="shistory" type="text" size="50" maxlength="48"></td>
</tr>
<tr>
<td>区域</td>
<td>
<div align="left">
<p>
<input name="shopesheng" class=t11 type="checkbox" id="hopesheng" value="全国" />
<label for="01">全?国</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="北京" />
<label for="02">北京</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="上海" />
<label for="03">上海</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="天津" />
<label for="04">天津</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="重庆" />
<label for="05">重庆</label>
<br />
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="广东" />
<label for="06">广东</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="福建" />
<label for="34">福建</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="浙江" />
<label for="07">浙江</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="江苏" />
<label for="08">江苏</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="山东" />
<label for="09">山东</label>
<br />
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="辽宁" />
<label for="10">辽宁</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="江西" />
<label for="11">江西</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="四川" />
<label for="12">四川</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="湖北" />
<label for="13">湖北</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="河北" />
<label for="14">河北</label>
<br />
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="陕西" />
<label for="15">陕西</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="河南" />
<label for="16">河南</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="吉林" />
<label for="17">吉林</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="黑龙江" />
<label for="18">黑龙江</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="山西" />
<label for="19">山西</label>
<br />
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="内蒙" />
<label for="20">内蒙</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="湖南" />
<label for="21">湖南</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="安徽" />
<label for="22">安徽</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="广西" />
<label for="35">广西</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="海南" />
<label for="23">海南</label>
<br/>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="云南" />
<label for="24">云南</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="西藏" />
<label for="25">西藏</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="贵州" />
<label for="26">贵州</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="甘肃" />
<label for="27">甘肃</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="宁夏" />
<label for="28">宁夏</label>
<br/>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="青海" />
<label for="29">青海</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="新疆" />
<label for="30">新疆</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="香港" />
<label for="31">香港</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="澳门" />
<label for="32">澳门</label>
<input class=t11 type="checkbox" name="shopesheng" id="hopesheng" value="台湾" />
<label for="33">台湾</label>
</p>
</div>
</td>
</tr>
<tr>
<td>求购述说</td>
<td>
<textarea name="stext" cols="50" rows="5" id="text3"></textarea>
</td>
<td>*</td>
</tr>
<tr>
<td>现有销售渠道</td>
<td><input id="text" name="schannels" type="text" size="50" maxlength="48"></td>
</tr>
<tr>
<td>联系方式</td>
</tr>
<tr>
<td>公司名称<input id="text1" name="name1" type="text" size="50" maxlength="48">
<input name="sshengfen" type="radio" value="公司" checked>公司
<input type="radio" name="sshengfen" value="个人" >个人</td>
</tr>
<tr>
<td>联系人<input id="text1" name="scontacts" type="text" size="50" maxlength="48"></td>
</tr>
<tr>
<td>电话<input id="text1" name="stelephone" type="text" size="50" maxlength="48">*</td>
</tr>
<tr>
<td>手机<input id="text1" name="stel" type="text" size="50" maxlength="48"></td>
</tr>
<tr>
<td>传真<input id="text1" name="sfax" type="text" size="50" maxlength="48"></td>
</tr>
<tr>
<td>联系地址<input id="text1" name="saddress" type="text" size="50" maxlength="48"></td>
</tr>
<tr>
<td>邮编<input id="text1" name="szip" type="text" size="50" maxlength="48"></td>
</tr>
<tr>
<td>网址<input id="text2" name="swebsite" type="text" size="50" maxlength="48">在线QQ:<input id="text2" name="sqq" type="text" size="50" maxlength="48"></td>
</tr>
<tr>
<td>电子邮箱<input id="text1" name="smail" type="text" size="50" maxlength="48"></td>
</tr>
<tr>
<td><input type="image" name="tijiao" value="提交" src="img/tijiao.jpg" style="border:0; "><img src="img/quxiao.jpg" onclick="document.all.form2.reset();" style="cursor:hand "/></td>
</tr>
</form>
</table>
-------------------b.asp
<%
strcheckbox=Request("checkbox_x")
if strcheckbox="" then
errstyle="·选择产品大类后请选择相应小类!"
scripterr
else
strcheckbox=strcheckbox
end if
ypxxone_id=Request("ypxxone_id")
if ypxxone_id="" then
errstyle="·选择产品大类后请选择相应小类!"
scripterr
else
ypxxone_id=ypxxone_id
end if
stitle = Request("stitle")
if stitle = "" then stitle = null
shistory = Request("shistory")
if shistory = "" then shistory = null
shopesheng = Request("shopesheng")
if shopesheng = "" then shopesheng = null
stext = Request("stext")
if stext=""or len(stext)<300 then
errstyle="·请输入小于300字的求购述说。"
scripterr --------------------------------------------第31行
end if
schannels = Request("schannels")
if schannels = "" then schannels = null
sname1 = Request("sname1")
if sname1 = "" then sname1 = null
sshengfen = Request("sshengfen")
if sshengfen="" then
errstyle="·请选择公司名称!"
scripterr
end if
scontacts = Request("scontacts")
if scontacts="" then
errstyle="·请输入联系人!"
scripterr
end if
stelephone = Request("stelephone")
if stelephone="" then
stelephone="·请输入电话!"
scripterr
end if
stel = Request("stel")
if stel = "" then stel = null
sfax = Request("sfax")
if sfax = "" then sfax = null
saddress = Request("saddress")
if saddress = "" then saddress = null
szip = Request("szip")
if szip = "" then szip = null
swebsite = Request("swebsite")
if swebsite = "" then swebsite = null
sqq = Request("sqq")
if sqq = "" then sqq = null
smail = Request("smail")
if smail = "" then smail = null
set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from zzwork3 "
rs.open sql,conn,1,3
rs.addnew()
rs("SMT_ypxxone_id") = ypxxone_id
rs("SMT_ypxxtwo_id") = strcheckbox
rs("title") = stitle
rs("history") = shistory
rs("hopesheng") = shopesheng
rs("text") = stext
rs("channels") = schannels
rs("name1") = sname1
rs("contacts") = scontacts
rs("shengfen") = sshengfen
rs("telephone") = stelephone
rs("tel") = stel
rs("fax") = sfax
rs("address") = saddress
rs("zip") = szip
rs("website") = swebsite
rs("qq") = sqq
rs("mail") = smail
rs("smt_ypaddone_id") = null
rs("smt_ypaddtwo_id") = null
rs.update
rs.close
set rs=nothing
conn.close
set conn = nothing
response.redirect("a.asp")
%>
数据库:
提交表单后,报错,没插入数据库,还望各位大侠指点,谢谢.
[此贴子已经被作者于2007-8-7 9:56:32编辑过]