3个页面
<input name="haha">
<script language=javascript>
function showwindow()
{
var str= window.showModalDialog('3.htm','window','dialogHeight: 550px; dialogWidth: 766px; center: Yes; help: No; resizable: Yes; status: No;');
alert(str);
document.getElementById("haha").value=str
}
showwindow();
</script>3.htm
<frameset cols="300,*">
<frame id="left" src="4.htm">
<frame id="right" src="1.htm">
</frameset>4.htm
<script language=javascript>
function closeWindow()
{
parent.window.returnValue="asdasdads"
parent.window.close();
}
</script>
<input name="button1" type="button" value="按" onclick="closeWindow();">

解决方案 »

  1.   

    以前处理过
    function add_open(a)
    {
    var ob=window.showModalDialog("add_admin.php",window,"dialogTop:500px;dialogLeft:300px;dialogHeight:350px;dialogWidth:700px;help:0;status:0");
    document.getElementById(a).value=ob;
    }
    function init(inType)
    {
    switch(inType)
    {
    case 'meeting':
    outHour='meeting_time_hour_start';
    outDate='meeting_date_start';
    break;
    case 'memo':
    outHour='memo_time_hour_start';
    outDate='memo_date_start';
    break;
    }
    var ob_hour=document.getElementById(outHour);
    var ob_date=document.getElementById(outDate);
    ob_date.value=window.dialogArguments.document.getElementById('hideTime').value.substring(0,10);
    h=window.dialogArguments.document.getElementById('hideTime').value.substring(10,12);
    for(i=0;i<ob_hour.length;i++)
    {
    if(ob_hour.options[i].value==h)ob_hour.options[i].selected=true;
    }
    }
    function sendback(a)
    {
    window.retrunValue=a;
    }
    基本上就是通过returnValue和window.dialogArguments这2个东东来获取
    中间可能需要有iframe来中转
      

  2.   

    我每次点击按钮以后<input name="haha">的都会清空掉阿,能不能让它可以保留以前的值呢
      

  3.   

    你让value保存在一个静态变量里或者服务端变量里好了