0
forma poupup 창을 게시하고 싶습니다. 문제는 양식이 성공적으로 게시되지만 부모 창에 게시된다는 것입니다. 나는 팝업 창에서 formonly을 제출하려는부모가 아닌 양식을 팝업 창에 게시하십시오.
'<input type= button value ="Submit Form" onclick="adNetworkForm()" >
<script>
function adNetworkForm(){
targetUrl = "http://somesite.com"
var myForm = document.createElement('form');
myForm.method = 'post';
//myForm.action = targetUrl;
var inpt1 = document.createElement('input');
inpt1.setAttribute('name','a');
inpt1.setAttribute('type', 'hidden')
inpt1.value = "1";
var inpt2 = document.createElement('input');
inpt2.setAttribute('name','b');
inpt2.setAttribute('type', 'hidden')
inpt2.value = 2;
myForm.appendChild(inpt1);
myForm.appendChild(inpt2);
document.body.appendChild(myForm);
myForm.submit(popitup(targetUrl));
document.body.removeChild(myForm);
}
function popitup(url) {
newwindow=window.open(url,'name','height=600,width=500');
if (window.focus) {newwindow.focus()}
return false;
}
</script>'
[Window.open 및 post 매개 변수로 매개 변수 전달] 가능한 복제본 (http://stackoverflow.com/questions/3951768/window-open-and-pass-parameters- by-post-method) –