请问怎么获取文本框数据啊?
用asp写的一个网页。
我要实现的功能是从一个文本框中输入一个条形码,然后按确定键就能把这本书添加到下面的列表中。但做出来却好像没有获得这个数据,请问高手我下面的程序哪里有错?
程序其中一部分如下:
<!-- #include file= "conn/conn.asp " -->
<% if request.Form( "jiezhang ")= "确定 " then
response.Redirect( "checkout.asp ")
end if
If Len(Session( "BookIDList ")) <> 0 Then
sql = "Select * From tb_bookinfo Where barcode In ( " &_
session( "bookIDList ") & ") Order By barcode "
Set rs = conn.Execute( sql )
'else
'Response.Redirect "borrow_empty.asp "
end if
barcode2=Request.Form( "barcode1 ")
%>
<script language= "javascript ">
function newwin(url){
window.location.href=url;
}
</script>
<form method= "POST " action= "borrow1.asp " name= "form2 ">
<tr bordercolor= "#FFFFFF " bordercolorlight= "#FFFFFF " bordercolordark= "#aaaaFF ">
<td height= "27 " align= "right " nowrap> 图书条形码: </td>
<td height= "27 "> <div align= "center ">
<input type= "text " name= "barcode1 " size= "32 " style= "border:1px solid;border-color:#000000 ">
</div> </td>
</tr>
<tr>
<td height= "58 " colspan= "2 " valign= "bottom " bgcolor= "#FFFFFF "> <div align= "center ">
<input type= "button " value= "提交 " onClick= "return newwin( 'borrow_add.asp?bookID=barcode '); " style= "border:1px solid;border-color:#AAAAFF;background-color:#ffcf00 ">
<input type= "reset " name= "Submit " value= "重置 "
onClick= "myreset() " style= "border:1px solid;border-color:#AAAAFF;background-color:#ffcf00 ">
<br>
</div> </td>
</tr>
</form>
ps:当我把上面onClick= "return newwin( 'borrow_add.asp?bookID=barcode ');中的barcode换成数据库中的其中某项条形码的时候,下面能够显示,所以我想应该不是没有列出来程序或borrow_add.asp的问题。
哪位大哥救救我???谢了
------解决方案--------------------你要递交到borrow1.asp还是borrow_add.asp,因为你的表单是borrow1.asp,而打开窗口是borrow_add.asp.
假设是递交到borrow1.asp
onClick= "document.form2.submit();newwin( 'borrow_add.asp?bookID=barcode ');)
borrow1.asp中可以取到Request.Form( "barcode1 ")
假设是递交到borrow_add.asp
onClick= "newwin( 'borrow_add.asp?bookID=barcode&barcode1=