28,390
社区成员
发帖
与我相关
我的任务
分享
<table>
<tr>
<td ondblclick="preSelect()">双击选择</td>
<td><input type="text" id="text1" value="显示数据1" /></td>
</tr>
<tr>
<td ondblclick="preSelect()"> </td>
<td><input name="textfield" type="text" id="textfield" value="显示数据2"></td>
</tr>
<tr>
<td ondblclick="preSelect()"> </td>
<td><input name="textfield2" type="text" id="textfield2" value="显示数据3"></td>
</tr>
</table>
<table width="338" border="0">
<tr>
<td width="158" nowrap>条件:
<input name="Test" type="text" id="text1" size="15" /></td>
<td width="164" nowrap><input type="button" value="搜索" onClick="ok()" /></td>
</tr>
</table>
<table>
<tr>
<td width="16">1</td>
<td width="85">数据11</td>
<td width="67">数据12</td>
<td width="99">数据13</td>
<td width="49"><input type="checkbox" name="ids" value="1" /></td>
</tr>
<tr>
<td>2</td>
<td>数据21</td>
<td>数据22</td>
<td>数据23</td>
<td><input type="checkbox" name="ids" value="2" /></td>
</tr>
<tr>
<td>3</td>
<td>数据31</td>
<td>数据32</td>
<td>数据33</td>
<td><input type="checkbox" name="ids" value="3" /></td>
</tr>
<tr>
<td>4</td>
<td>数据41</td>
<td>数据42</td>
<td>数据43</td>
<td><input type="checkbox" name="ids" value="4" /></td>
</tr>
</table>
<input type="button" value="确定" onclick="ok()" />
<input type="button" value="取消" onclick="window.close()" />
<table>
<tr>
<td ondblclick="preSelect()">双击选择</td>
<td><input type="text" id="text1" value="这里显示被选择的ID" /></td>
</tr>
</table>
<script>
function preSelect(){
showModalDialog("模式b.html", window, "");
}
function setValue(value){
document.getElementById("text1").value = value;
}
</script>
<table>
<tr>
<td>1</td>
<td>第1条数据</td>
<td><input type="checkbox" name="ids" value="1" /></td>
</tr>
<tr>
<td>2</td>
<td>第2条数据</td>
<td><input type="checkbox" name="ids" value="2" /></td>
</tr>
<tr>
<td>3</td>
<td>第3条数据</td>
<td><input type="checkbox" name="ids" value="3" /></td>
</tr>
<tr>
<td>4</td>
<td>第4条数据</td>
<td><input type="checkbox" name="ids" value="4" /></td>
</tr>
<tr>
<td>5</td>
<td>第5条数据</td>
<td><input type="checkbox" name="ids" value="5" /></td>
</tr>
</table>
<input type="button" value="确定" onclick="ok()" />
<input type="button" value="取消" onclick="window.close()" />
<script>
function ok(){
var checkedValue = "";
var ids = document.getElementsByName("ids");
for(var i = 0; i < ids.length; i++){
if(ids[i].checked){
checkedValue += ids[i].value + ",";
}
}
checkedValue = checkedValue.replace(/,$/, "");
window.dialogArguments.setValue(checkedValue);
window.close();
}
</script>
<table>
<tr>
<td>
<input type=text name="test" ondblclick="OpenWindow('test.asp','test page');">
</td>
</tr>
</table>
<script language="JavaScript">
function OpenWindow(url,windowname)
{
window.open(url,windowname,'left=150,top=100,height=300,width=400,toolbar=no,menubar=no,scrollbars=no')
}
</script>
<!--#include file="Js/Conn.asp" -->
<form name="form1" method="post" action="模式b.html
">
<TABLE width=322 height=30 border=0 cellpadding=0 cellspacing=0 class=zi>
<TR>
<TD width=12% align=right nowrap>测试:</TD>
<TD width=51% nowrap>
<input name=Test type=text id=Test size=6></TD>
<TD width=37% nowrap>
<input type=submit name=Submit value=搜索 /></TD>
</TR>
</TABLE>
</form>
<%
Set rs=Server.CreateObject("ADODB.RecordSet")
if request.Form("Test")<>"" then
Test1=request.Form("Test")
' Test2=request.Form("Asset_ID")
sql="select * from Standard where Use_ID='"&Test1&"'"
rs.Open sql,conn,1,3
%>
<table width="400">
<%
dim sum
sum=0
do while not rs.eof
sum=sum+1
%>
<tr>
<td width="23"><%=sum%></td>
<td width="338"><%=rs("Asset_Name")%>---<%=rs("Asset_ID")%>---<%=rs("Asset_Brand")%>
</td>
<td width="23">
<input type="checkbox" name="ids" productid="1" productname="<%=rs("Asset_Name")%>" code="<%=rs("Asset_ID")%>" brand="<%=rs("Asset_Brand")%>" /></td>
</tr>
<%
rs.movenext
loop
rs.close
%>
</table>
<input type="button" value="确定" onclick="ok()" />
<input type="button" value="取消" onclick="window.close()" />
<% else
response.Write("请先查询数据")
end if
%>
<script>
function ok(){
textid = document.URL.replace(/textid=([^&]*)/, "$1");
var cb = null;
var ids = document.getElementsByName("ids");
for(var i = 0; i < ids.length; i++){
if(ids[i].checked){
cb = ids[i];
}
}
window.dialogArguments.setValue(cb);
window.close();
}
</script>
<table>
<tr>
<td ondblclick="preSelect('text1')">双击选择</td>
<td><input type="text" id="text1" value="" /></td>
<td><input type="text" id="text2" value="" /></td>
</tr>
<tr>
<td></td>
<td><input type="text" id="text3" value="" /></td>
<td><input type="text" id="text4" value="" /></td>
</tr>
</table>
<script>
function preSelect(){
showModalDialog("模式b.html", window, "");
}
function setValue(cb){
document.getElementById("text1").value = cb.getAttribute("productid");
document.getElementById("text2").value = cb.getAttribute("productname");
document.getElementById("text3").value = cb.getAttribute("code");
document.getElementById("text4").value = cb.getAttribute("brand");
}
</script>
<table>
<tr>
<td>1</td>
<td>第1条数据</td>
<td><input type="checkbox" name="ids" productid="1" productname="产品1号" code="11" brand="品牌1" /></td>
</tr>
<tr>
<tr>
<td>2</td>
<td>第2条数据</td>
<td><input type="checkbox" name="ids" productid="2" productname="产品2号" code="22" brand="品牌2" /></td>
</tr>
<tr>
<tr>
<td>3</td>
<td>第3条数据</td>
<td><input type="checkbox" name="ids" productid="3" productname="产品3号" code="33" brand="品牌3" /></td>
</tr>
<tr>
<tr>
<td>4</td>
<td>第4条数据</td>
<td><input type="checkbox" name="ids" productid="4" productname="产品4号" code="44" brand="品牌4" /></td>
</tr>
<tr>
<tr>
<td>5</td>
<td>第5条数据</td>
<td><input type="checkbox" name="ids" productid="5" productname="产品5号" code="55" brand="品牌5" /></td>
</tr>
<tr>
</table>
<input type="button" value="确定" onclick="ok()" />
<input type="button" value="取消" onclick="window.close()" />
<script>
function ok(){
textid = document.URL.replace(/textid=([^&]*)/, "$1");
var cb = null;
var ids = document.getElementsByName("ids");
for(var i = 0; i < ids.length; i++){
if(ids[i].checked){
cb = ids[i];
}
}
window.dialogArguments.setValue(cb);
window.close();
}
</script>
<table width="400" border="1">
<tr>
<td width="61"> </td>
<td colspan="3">双击此处选择</td>
</tr>
<tr>
<td>写入日期:</td>
<td width="143">
<input type="text" name="aa" id="aa" value="<%=date()%>"></td>
<td width="69">名称: </td>
<td width="99"><input type="text" name="textfield" id="textfield"></td>
</tr>
<tr>
<td>编号:</td>
<td><input type="text" name="textfield2" id="textfield2"></td>
<td>品牌:</td>
<td><input type="text" name="textfield3" id="textfield3"></td>
</tr>
<tr>
<td colspan="4" align="center"><input type="submit" name="button" id="button" value="保存">
<input type="button" name="button2" id="button2" value="取消"></td>
</tr>
</table>
<!--#include file="Js/Conn.asp" -->
<form name="form1" method="post" action="15.asp">
<TABLE width=322 height=30 border=0 cellpadding=0 cellspacing=0 class=zi>
<TR>
<TD width=12% align=right nowrap>测试:</TD>
<TD width=51% nowrap>
<input name=Test type=text id=Test size=6></TD>
<TD width=37% nowrap>
<input type=submit name=Submit value=搜索 /></TD>
</TR>
</TABLE>
</form>
<%
Set rs=Server.CreateObject("ADODB.RecordSet")
if request.Form("Test")<>"" then
Test1=request.Form("Test")
' Test2=request.Form("Asset_ID")
sql="select * from Standard where Use_ID='"&Test1&"'"
rs.Open sql,conn,1,3
%>
<table border="1">
<tr>
<td>序号</td>
<td>名称</td>
<td>编号</td>
<td>品牌</td>
<td>选择</td>
</tr>
<%
dim sum
sum=0
do while not rs.eof
sum=sum+1
%>
<tr>
<td width="16"><%=sum%></td>
<td width="85"><%=rs("Asset_Name")%></td>
<td width="67"><%=rs("Asset_ID")%></td>
<td width="99"><%=rs("Asset_Brand")%></td>
<td width="49"><input type="checkbox" name="checkbox" id="checkbox" /></td>
</tr>
<%
rs.movenext
loop
rs.close
%>
</table>
<input type="button" value="确定" onclick="ok()" />
<input type="button" value="取消" onclick="window.close()" />
<% else
response.Write("请先查询数据")
end if
%>
<table>
<tr>
<td ondblclick="preSelect('text1')">双击选择</td>
<td><input type="text" id="text1" value="这里显示被选择的ID" /></td>
</tr>
<tr>
<td ondblclick="preSelect('text2')">双击选择</td>
<td><input type="text" id="text2" value="这里显示被选择的ID" /></td>
</tr>
</table>
<script>
var textid = null;
function preSelect(newtextid){
textid = newtextid;
showModalDialog("模式b.html", window, "");
}
function setValue(value){
document.getElementById(textid).value = value;
}
</script>