Sub DisplaySurvey(TypeNum,Qnum,hrefPage ) dim qnumber,qvalue ,strTitle
strSql="Select * From Infotype Where TypePId="&TypeNum&" Order by TypeID Desc" adoRst.Open StrSql,adoCon If adoRst.Eof then adoRst.Close response.write "暂时没有调查问题!" exit sub End if strTitle=adoRst("typeName")
Response.Write "<table Border='0' Cellspacing='0' Cellpanding='0'> <tr> <td>" response.Write "<form name=form1 method=Post action='"& hrefpage &"?TypeId="&adorst("TypeID")&"' >" 'Response.Write "<input type=hidden name=typeId value='"&adorst("TypeId")&"'>" Response.Write "<input type=hidden name=type value='do'>" Response.Write "<tr><td><b>" & strTitle & "</td></tr>" Qvalue=adorst("TypeID") adorst.Close strsql="select * from information where typeid="&Qvalue adorst.open strsql,adocon Do While Not adoRst.Eof Response.Write "<tr><td><input type='radio' name='answer' value='"&adorst("InfoId")&"'>"&adorst("title")&"</td></tr>" adoRst.movenext Loop Response.Write "<tr height=15><td></td></tr><tr><td><div align=center>" response.write "<input class=mubutton type='button' value=' 提交 '" response.write "onclick="&chr(34)&"window.open('"& hrefpage &"?TypeId="&qvalue&"','','width=300,height=400');document.form1.answer.submit();return false"&chr(34)&">" response.write " <input type=button value='查看结果' class=mubutton onclick="&chr(34)&"window.open('survey.asp?typeID="&Qvalue&"','网站调查结果','Width=300 Height=400')"&chr(34)&"></div></td></tr>" Response.Write "<tr><td height=20></td></tr></form></table>" adorst.close End Sub '------------------- ' onsubmit="&chr(34)&"window.open('"& hrefpage &"?TypeId="&adorst("TypeID")&"&answer=document.form1.answer.value','','width=300,height=400');document.form1.answer.submit();return false"&chr(34)&" '-------------------'处理用户递交的网站调查表单 Sub DevSurvey() Dim TotalCount,qcount if Request.form("type")="do" then if not request.Form ("answer")="" then strSql="Update information set clickcount=Clickcount+1 Where InfoID="&Request.Form("answer") adocon.execute strSql else response.Write "<div align='center'><b> 注 意 </b></div><br><br> 你没有选择任何项目进行投票,请先选择后再进行投票!这样才能看到调查的结果!" exit sub End IF end If strsql="select * from InfoType where TypeId="&Request.querystring("TypeID") adorst.Open strSql,adocon response.write("<table height='70%'><tr><td colspan=3><div align=center><b>"&adorst("TypeName")&"</div></td></tr>") adorst.close strSql="select * from Information where TypeID="&Request.querystring("TypeID")& " Order By ClickCount desc" adorst.Open strSql,adocon totalcount=0 qcount=0 do while Not adorst.eof totalcount=totalcount+adorst("clickcount") qcount=qcount+1 adorst.MoveNext Loop adorst.MoveFirst do while not adorst.eof Response.Write "<tr><td width='50%'>"&adorst("title")&":</td><td><div align='left'><hr size=5 color=#FF6666 width="&((adorst("clickcount")/totalcount)*200)&"></div></td><td>"&adorst("clickcount")&"</td></tr>" adorst.MoveNext loop response.write "<tr><td colspan=3><hr color='#CCCCFF'><br>现在产生的总投票数为:"&totalcount&"票</td></tr></table>"adorst.close End Sub怎么解决?
<input type="text" name="abc">
<input type="button" name="Submit" value="送出" onClick="window.open('xxx.asp?abc=document.form1.abc.value','_self','toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=no')">
</form>
这样的方法我试了一下,但是abc无法获得值,我是在ASP中写的。
生成的HTML代码是
<form name=form1 method=Post action='Survey.asp?TypeId=46' onsubmit="window.open('Survey.asp?TypeId=46&answer=document.form1.answer.value','width=300,height=200')
action='admin/adminlogin.aspx' target='YellowWee'<input type="button" onclick='sm()'>
function sm(){
window.open('','YellowWee','width=300,height=340,status=no,scrollbars=no,left=80,top=80')
document.forms[0].submit()
}
这样不行,我的数据递交不上去,要么就是打开2个窗口
怎么办?
dim qnumber,qvalue ,strTitle
strSql="Select * From Infotype Where TypePId="&TypeNum&" Order by TypeID Desc"
adoRst.Open StrSql,adoCon
If adoRst.Eof then
adoRst.Close
response.write "暂时没有调查问题!"
exit sub
End if
strTitle=adoRst("typeName")
Response.Write "<table Border='0' Cellspacing='0' Cellpanding='0'> <tr> <td>"
response.Write "<form name=form1 method=Post action='"& hrefpage &"?TypeId="&adorst("TypeID")&"' >"
'Response.Write "<input type=hidden name=typeId value='"&adorst("TypeId")&"'>"
Response.Write "<input type=hidden name=type value='do'>"
Response.Write "<tr><td><b>" & strTitle & "</td></tr>"
Qvalue=adorst("TypeID")
adorst.Close
strsql="select * from information where typeid="&Qvalue
adorst.open strsql,adocon
Do While Not adoRst.Eof
Response.Write "<tr><td><input type='radio' name='answer' value='"&adorst("InfoId")&"'>"&adorst("title")&"</td></tr>"
adoRst.movenext
Loop
Response.Write "<tr height=15><td></td></tr><tr><td><div align=center>"
response.write "<input class=mubutton type='button' value=' 提交 '"
response.write "onclick="&chr(34)&"window.open('"& hrefpage &"?TypeId="&qvalue&"','','width=300,height=400');document.form1.answer.submit();return false"&chr(34)&">"
response.write " <input type=button value='查看结果' class=mubutton onclick="&chr(34)&"window.open('survey.asp?typeID="&Qvalue&"','网站调查结果','Width=300 Height=400')"&chr(34)&"></div></td></tr>"
Response.Write "<tr><td height=20></td></tr></form></table>"
adorst.close
End Sub '-------------------
' onsubmit="&chr(34)&"window.open('"& hrefpage &"?TypeId="&adorst("TypeID")&"&answer=document.form1.answer.value','','width=300,height=400');document.form1.answer.submit();return false"&chr(34)&"
'-------------------'处理用户递交的网站调查表单
Sub DevSurvey()
Dim TotalCount,qcount
if Request.form("type")="do" then
if not request.Form ("answer")="" then
strSql="Update information set clickcount=Clickcount+1 Where InfoID="&Request.Form("answer")
adocon.execute strSql
else
response.Write "<div align='center'><b> 注 意 </b></div><br><br> 你没有选择任何项目进行投票,请先选择后再进行投票!这样才能看到调查的结果!"
exit sub
End IF
end If
strsql="select * from InfoType where TypeId="&Request.querystring("TypeID")
adorst.Open strSql,adocon
response.write("<table height='70%'><tr><td colspan=3><div align=center><b>"&adorst("TypeName")&"</div></td></tr>")
adorst.close
strSql="select * from Information where TypeID="&Request.querystring("TypeID")& " Order By ClickCount desc"
adorst.Open strSql,adocon
totalcount=0
qcount=0
do while Not adorst.eof
totalcount=totalcount+adorst("clickcount")
qcount=qcount+1
adorst.MoveNext
Loop
adorst.MoveFirst
do while not adorst.eof
Response.Write "<tr><td width='50%'>"&adorst("title")&":</td><td><div align='left'><hr size=5 color=#FF6666 width="&((adorst("clickcount")/totalcount)*200)&"></div></td><td>"&adorst("clickcount")&"</td></tr>"
adorst.MoveNext
loop
response.write "<tr><td colspan=3><hr color='#CCCCFF'><br>现在产生的总投票数为:"&totalcount&"票</td></tr></table>"adorst.close
End Sub怎么解决?