1

主页.php

<a href='javascript:void(0);' onclick="pepz('<?php echo"ppc-mngt_transfer.php?id=$i->sm_id"; ?>', 'myPop1',400,400)"><?php print"$i->sm_jo<br>$i->sm_custo_name"; ?></a>

ppc-mngt_transfer.php

  <script type="text/javascript">
        function refreshAndClose() {
            window.close();
            window.opener.location.reload(true);
        }
    </script>
    <body onbeforeunload="refreshAndClose();">
    <form name='mainform' method='post' action='do.php?ppc/workload'>
    <?php
    print "<h1>COPY TO WORKLOAD</h1>";
    print "<table class='clean_form'>";
    print "<tr><td>J.O. Number</td><td><input name='ppc_jo' value='$i->sm_jo' style='width:250'></td></tr>";
    print "<tr><td>Customer Name</td><td><input name='ppc_custo_name' value='$i->sm_custo_name' style='width:250'></td></tr>";
    print "<tr><td>Description</td><td><input name='ppc_subject' value='$i->sm_subject' style='width:250'></td></tr>";
    print "<tr><td>Date Start</td><td><input name='ppc_dpdate' value='$i->sm_dpdate' style='width:250'></td></tr>";
    print "<tr><td>Duration</td><td><input name='ppc_proj_duration' value='$i->sm_proj_duration' style='width:250'></td></tr>";
    print "<input type='hidden' name='ppc_m_id' value='$id'>";
    print "</table>";
    print "<tr><input type='checkbox' name='ppc_mark' value='ok' checked/></tr>";
    ?>
    <input type="submit" value="submit">
    </form>
    </body>

我认为我的代码执行此操作 > REFRESH 然后关闭 ...。我需要的是在单击弹出窗口中的提交按钮后关闭,然后刷新父页面。请帮助我,我对 Javascript 知之甚少。

4

1 回答 1

0
<form name='mainform' method='post' action='do.php?ppc/workload' onsubmit="refreshAndClose();">


function refreshAndClose() {
            window.opener.location.reload(true);
            window.close();
}

Just make sure the form is really submitted, if not, we need to tweak it a bit.

I would actually to the window.close() in the do.php file. So u can also handle submission errors, if they occur.

于 2012-09-06T01:59:16.867 回答