js弹出窗口传递值

页面1

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function open_windows_and_get_selectedinfo(openwindow, control, control2) {
var str = window.showModalDialog(openwindow, window, "dialogWidth=740px;dialogHeight=600px;center=yes;help=no;resizable=no;status=no");
if (!str)
return;
document.getElementById(control).value = str[0];
document.getElementById(control2).value = str[1];
}

</script>
</head>
<body>
<form id="form1" runat="server">
<div id="autosuggest" style="width:160px;font-size:12px;"><ul></ul></div>
<div>
<input id="txtActive" runat="server" readonly="readonly" />
<input type="button" id="selectActive" runat="server" onclick="javascript:open_windows_and_get_selectedinfo(‘2.html‘,‘hfActive‘,‘txtActive‘)" value="..." />
<asp:HiddenField ID="hfActive" runat="server" />
</div>
</form>
</body>
</html>

页面2

<html xmlns="http://www.w3.org/1999/xhtml">
<base target="_self">
<head runat="server">
<title></title>
<script type="text/javascript" language="javascript">
function dbclick_return_and_close(strid, strvalue) {
alert("执行该方法!");
var str = new Array(strid, strvalue);

window.returnValue = str;
window.close();
}
</script>
</head>
<body>
<div>
<a href="#" onclick="javascript:dbclick_return_and_close( ‘1‘, ‘aaaaaaa‘);">点击这一行,带值返回到原页面</a>
</div>
</body>
</html>

时间: 2024-10-26 18:35:20

js弹出窗口传递值的相关文章

js 弹出窗口 选值后提交回父级页(不刷新)的文本框

在父级页 设置两个 文本框 id 和 name和 一个弹出窗口按钮 在弹出窗口中列出若干条记录,现需要将任意一条记录点击提交.将该条记录的 id 和 name 字段 返回到父级对应的文本框中.不刷新父级页面. 父窗口代码:(命名随意)<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&

[King.yue]Ext.JS 弹出窗体取值赋值

//从Grid取值var name = Ext.getCmp(gridGridID).getView().getSelectionModel().getSelection()[0].data.Name; var code = Ext.getCmp(gridGridID).getView().getSelectionModel().getSelection()[0].data.Code; //赋值ID Ext.getCmp('@V.ID_TXT_NAME').setValue(name);//不用

Js弹出窗口代码,window.open方法

<html><script language=JavaScript> <!--function click() {if (event.button==2) {window.open('#','popwindows',"toolbar=no,menubar=no,width=200,height=200")}}document.onmousedown=click//--></script><head><meta http-

JS弹出窗口代码大全(详细整理)

1.弹启一个全屏窗口 复制代码代码如下: <html> <body http://www.jb51.net','脚本之家','fullscreen');">; <b>www.jb51.net</b> </body> </html> 2.弹启一个被F11化后的窗口 复制代码代码如下: <html> <body 'http://www.jb51.net','脚本之家','channelmode');"

js弹出窗口总结6种弹窗方法

注: //关闭,父窗口弹出对话框,子窗口直接关闭 this.Response.Write("<script language=javascript>window.close();</script>"); //关闭,父窗口和子窗口都不弹出对话框,直接关闭 this.Response.Write("<script>"); this.Response.Write("{top.opener =null;top.close();}

CSS+JS 弹出窗口

需要引入样式 .black_overlay{  display: none;  position: absolute;  top: 0%;  left: 0%;  width: 100%;  height: 100%;  background-color: black;  z-index:1001;  -moz-opacity: 0.8;  opacity:.80;  filter: alpha(opacity=80);  }    .white_content {  display: none

js弹出窗口获取父窗口的值

1.html <html> <head> <title>1.html</title> <script type="text/javascript"> function test() { //弹出一个新窗口2.html window.open ('2.html') } </script> </head> <body> <input name="mytext" type

js 弹出窗口 防止拦截,突破阻止,保存后打开

<script language="javascript"> function orderprint() { var formUrl = "savedata_url"; var formPrint ="";//保存成功后要弹出的窗口 $.ajax({ url: formUrl, data: $('#form1').serialize(), dataType: "html", async:false,//------

js弹出窗口

function openModalDialog(url, height, width) { var t_height = 400; var t_width = 600; if (!isNaN(height)) { t_height = height; } if (!isNaN(width)) { t_width = width; } showModalDialog(url, 'newwindow', 'dialogWidth:' + t_width + 'px;dialogHeight:' +