我有一个弹出提交表单,一旦我提交它应该使用 window.load 方法将弹出窗口加载到我的当前窗口中。问题是我总是被重定向到那个窗口(imagine_decupare.php),而不是让那个窗口作为弹出窗口加载到我当前的窗口中。关于为什么的任何想法?
function hide_popup(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == ""){
obj.style.display = "none";
}
}
}
function poponload(){
testwindow = window.open("decupare_imagine.php","mywindow","location=0,status=1,scrollbars=1,width=100,height=100");
testwindow.moveTo(0, 0);
}
<form action="decupare_imagine.php" method="post" >
<input type="text" name="alt-rol" value="<?php echo $data[1];?>" style="display:none;" />
<a href="javascript:hide_popup('my_popup<?=$data[1]?>')" style="width:5%;float:left;margin: 0 0 0 90%"><img src="../images/icon_error.gif"> </a>
<div class="radio_pop">
//some data to be sent
</div>
<input type="submit" value="Tip imagine" class="buton_imagine" onclick="javascript:hide_popup('my_popup<?=$data[1]?>');" onsubmit="javascript: poponload()" style="width:100%;float:left;" />
</form>