[此贴子已经被作者于2007-7-7 20:55:39编辑过]
用JS获取值,同过GET方式提交到新页面,
<input type="text" value="1" ondblclick="alert(this.value)">
我的代码如下,各位给看看:
<form name="form1">
<p><input name="T1" type="text" ondblclick="window.open('a.asp','colorPicker')" />
<input name="T2" type="text" />
</p>
</form>
a.asp 如下:
<!--#include file="../dbtest/conn.asp"-->
<script language="Javascript">
function pic(bh,name)
{
window.opener.document.form1.T1.value=bh;
window.opener.document.form1.T2.value=name;
window.close();
}
</script>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from table2"
rs.open sql,conn,1,3
%>
<table width="335" border="1" align="center" ondblclick="Javascript:pic('<%=rs("dm")%>','<%=rs("xm")%>')">
<tr>
<td width="48" bgcolor="#000099"><div align="center">dm</div></td>
<td width="102" bgcolor="#00CC99"><div align="center">xm</div></td>
<td width="56" bgcolor="#00CC99"><div align="center">age</div></td>
<td width="101" bgcolor="#00CC99"><div align="center">add</div></td>
</tr>
<%
do while (not rs.eof)
response.write"<tr>"
response.write"<td align=center>"&rs("dm")&"</td>"
response.write"<td align=center>"&rs("xm")&"</td>"
response.write"<td align=center>"&rs("age")&"</td>"
response.write"<td align=center>"&rs("add")&"</td>"
response.write"</tr>"
rs.movenext
loop
%>
</table>
运行结果是不管鼠标双击哪条记录,在T1和T2中总填入第一条的值.怎么修改?