I have a page where a user can click on a button that opens a new window using Javascript's window.open. The new "pop-up" window allows users to perform various editing actions. After processing is completed in the new window, I want to be able to return to the original page, passing the status of the completed process back, via the query string. Unfortunately, the new window stays open (in it's smaller size), with the original page visible behind it. I am trying to simply return back to the original calling page, whilst the new window closes. I believe the answer to this question must be in the way that the window.open is used in the first place. If the window was NOT opened in a new tab, and instead was "in-place", then I believe this would work as I want it to.
Snippets of the code are as follows:
I. HTML on original page:
<input type="button" style="cursor: hand; color: #000000; font-size: 9px; font-style: bold" name="edittransaction" id="edittransaction" value="Edit Transaction" onclick="EditTransaction(this.form);">
II. Javascript on original page:
function EditTransaction(f) {
var edit_option = '<%=EditOption%>';
var orderid_values = document.getElementsByName('OrderIDValues');
var orderid_value = '';
for(var i = 0; i < orderid_values.length; i++){
if(orderid_values[i].checked){
orderid_value = orderid_values[i].value;
}
}
if (orderid_value != undefined && orderid_value != null)
{
window.open("/memberlogin/orders/edittransaction.asp?cert=<%=sCertificate%>&loginid=<%=iSessID%>&cid=<%=iCustomerID%>&editoption=<%=EditOption%>&transactionid=" + orderid_value ,"dialogEditTransaction","resizable=0,scrollbars=yes,location=yes,toolbar=no,status=no,top=600,left=400,width=800,height=800");
} else {
alert("Please select a transaction.");
}
} // End of EditTransaction() function
III. VBscript code on the opened page (in a window), which occurs after processing is complete:
FinalStatusURL = "/memberlogin/orders/transactionhistory.asp" & "?cert=" & sCertificate & "&loginid=" & iSessID & "&cid=" & iCustomerID & "&trxid=" & iTrxID & "&finalstatus=" & finalstatuscode
Response.Redirect(FinalStatusURL)
Response.End
Please note that the new window does not necessary need to be a pop-up window. It can be full sized. Please let me know what I need to do, in order to simply close the pop-up window upon a redirect back to the original page. Thank you very much!