0
<button class="Button" onclick="NewTicket()">New Ticket</button>

<script language=javascript>
   function OpenPopup( url, winname, features )
   {
    if(winname==''){
     window.open( url, winname, features, false );
     return;
    }
    if ( !findWindow( url, winname, features ) )
    {
     var handle = window.open( url, winname, features, false );
     if ( handle != null ) handle.focus();
    }
   }

   function findWindow( url, winname, features )
   {
    var handle = window.open( '', winname, features, false );
    if ( handle != null )
    {
     if (( handle.location != 'about:blank' ) && ( handle.location != '' ))
     {
      handle.focus();
      return true;
     }
    }
    return false;
   }
function NewTicket(){
    OpenPopup('../Ticket/New.php', 'NewTicket', 'channelmode=0, directories=0, fullscreen=0, width=430, height=360, location=0, menubar=0, resizable=0, scrollbars=1, status=0, titlebar=1, toolbar=0', false);
}
</script>

使用此代码打开一个弹出式表单。这一点没有问题。我想再次将表单 (../Ticket/New.php) 发布回此页面。我怎样才能做到这一点?

4

1 回答 1

0

您需要为当前窗口设置一个名称。在您的窗口打开功能之前,在您有打开按钮的页面上添加以下代码段。

<script>window.name = 'mainwindow';</script>

在您的 New.php 中,将目标属性添加到您的表单中,并将值设置为“主窗口”

<form target="mainwindow">
于 2013-02-13T19:15:42.100 回答