form 전송, 버튼 클릭시 새창/함수불러오기
<input class="comp_click" type="submit" value="선택" onclick="window.open('/urawum/1','','height=400,width=400'); return false;">
<form action="w_2/get_comp2.php" method="post" id="asdddd" name="coddmp" enctype="multipart/form-data" target="_blank">
<input type="text" id="thePopupField">
<br><input type="button" value="Send Form" onclick="doTheSubmit();">
<script>
function doTheSubmit() {
window.close();
var doc = window.opener.document,
theForm = doc.getElementById("theForm"),
theField = doc.getElementById("theField");
theField.value = document.getElementById("thePopupField").value;
theForm.submit();
} setTimeout('doTheSubmit();', 200);
</script>
enctype="multipart/form-data"
onsubmit="checksaveform()"
onclick="window.open('w_2/get_comp2.php','','height=400,width=400'); return false;"
onsubmit="return false;"
confirm : <a href="http://www.naver.com" onclick="return confirm('Are you sure you want to do that?');">Click Me</a>
<form action="w_2/get_comp2.php" method="post" id="asdddd" name="coddmp" enctype="multipart/form-data">
<script>
function doTheSubmit() {
alert("fff")
//var doc = window.opener.document;
theField = window.opener.document.getElementById("get_comp_span_1").firstChild.data;
alert(theField);
try {
window.opener.HandlePopupResult("asdf");
}
catch (err) {}
window.close();
return false;
window.close();
theForm.submit();
} setTimeout('doTheSubmit();', 200);
</script>
<?php
$what_kind = $_POST["what_kind"];
$what_bbs = $_POST["what_bbs"];
?>
http://stackoverflow.com/questions/9276086/popup-window-to-return-data-to-parent-on-close
https://forums.digitalpoint.com/threads/help-with-tinybox-javascript-popup-box.2061743/
http://www.scriptiny.com/2009/05/javascript-popup-box/
'웹관련정보' 카테고리의 다른 글
jquery 이용하여 input 숫자만 입력가능하도록 (0) | 2014.01.17 |
---|---|
DOM 설정 (0) | 2014.01.17 |
텍스트 줄바꿈, 글자자르기 CSS (0) | 2014.01.06 |
jquery를 이용하여 hover시 툴팁과 이미지 미리보기 (0) | 2013.12.18 |
북마크시 iphone 인지 안드로이드 인지 일반 컴퓨터인지 확인후 아이콘설정 (0) | 2013.12.18 |