I would like to be able to open a child window and then check when returning the value to the parent that it is still open. My code used is as follows:
=============
[PARENT PAGE]
=============
<script language="JavaScript">
<!--
function go(){
window.open(" "","toolbar=1,directories=0,status=1,menubar=0,scrollbars=yes,resizeable=no,width=788,height=500"
;
}
// End -->
</script>
<input type="submit" name="Submit3" value="Image Library Database" onclick=go()>
============
[CHILD PAGE]
============
<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
<!--- Hide script from old browsers
<!-- used in [index_view_buttons.inc] to send data to aplaws -->
function process() {
$Transfer = opener.document.form1.data.value = '<? echo $filename; ?>';
if ($Transfer) {
self.close();
}
else {
alert("The process has been cancelled because the destination window has been closed..."
;
}
}
// End hiding script from old browsers -->
</SCRIPT>
<a href="javascript
nclick=process()">
There are other things to consider. In the child window I may have to navigate through a few pages first (it is not a static, one page window) before sending the data back to the parent. The code has been placed on the send page where the user navigates to.
Another problem. The parent window may be closed, moved on or back from the original page (after opening the child) where the procedure commenced. It is important to be using exactly the same page as was used to start the procedure and not just to re-open the url and paste the data into the relevant text box. If it is not on exactly the same page then just produce an alert message and do nothing with the data.
Many thanks for any suggestions or ideas...
=============
[PARENT PAGE]
=============
<script language="JavaScript">
<!--
function go(){
window.open(" "","toolbar=1,directories=0,status=1,menubar=0,scrollbars=yes,resizeable=no,width=788,height=500"
}
// End -->
</script>
<input type="submit" name="Submit3" value="Image Library Database" onclick=go()>
============
[CHILD PAGE]
============
<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
<!--- Hide script from old browsers
<!-- used in [index_view_buttons.inc] to send data to aplaws -->
function process() {
$Transfer = opener.document.form1.data.value = '<? echo $filename; ?>';
if ($Transfer) {
self.close();
}
else {
alert("The process has been cancelled because the destination window has been closed..."
}
}
// End hiding script from old browsers -->
</SCRIPT>
<a href="javascript
There are other things to consider. In the child window I may have to navigate through a few pages first (it is not a static, one page window) before sending the data back to the parent. The code has been placed on the send page where the user navigates to.
Another problem. The parent window may be closed, moved on or back from the original page (after opening the child) where the procedure commenced. It is important to be using exactly the same page as was used to start the procedure and not just to re-open the url and paste the data into the relevant text box. If it is not on exactly the same page then just produce an alert message and do nothing with the data.
Many thanks for any suggestions or ideas...