<script language="javascript">
function SubForm()
{
var tmp = 0;
for(i=0;i<=document.all("select1").length;i++)
{
if(document.all("select1")[i].selected == true)
{
window.alert(document.all("select1").options[i].innerText);
window.open("MapCommision.asp?id=" + document.all("select1").value,'_blank',"");
window.alert("上一条授权完毕,请插下一张卡");
tmp++;
}
}
if(tmp==0)
{
window.alert("请选择一个硬件编码");
return false;
}
else
{
return true;
}
}
</script>
<p align="center" class="style1"> <font color="#000000">授权信息</font></p>
<form method="post" name="downform" action="MapCommision.asp">
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<select name="select1" size="20" multiple>
<%
UserName=Session("UserName")
set rs=server.CreateObject("ADODB.RecordSet")
rs.Source="select * from MapCommision where Username='"&UserName&"'"
rs.Open rs.Source,conn,1,1
if not rs.EOF then
while not rs.EOF
Response.Write "<option value="""&rs("id")&""">"&rs("HardWareNo") &"</option>"
rs.MoveNext
wend
else
Response.Write "<option value=''>目前还没有</option>"
end if
rs.Close
set rs=nothing
%>
</select>
</td>
<tr>
<tr>
<td><p align="center"><input type="button" value=" 数据授权 " onclick="SubForm()"></p></td>
</tr>
</table>
</form>
上面的有个错误。为多选时,总是循环传送最上边的那一个id值,下面的id不传送。这个问题还没解决呀!谢谢
[此贴子已经被作者于2006-9-1 16:53:39编辑过]