How to close popup and save document in the same time

I tried to close a pop-up window and save the information I entered in the popup to a document, then back to parent window.

But so far I can only see one thing happened, either closing the popup or saving the document. I want both happens.

I had a button called"done" on the form in the popup. in 'onclick", I put following javascript:

.submit();

window.close()

any thing wrong?

thanks for your help

Subject: how to close popup and save document in the same time

//first you need to update the opener. .

opener.document.getElementById(“FieldName”).value = document.getElementById(“popupDocFieldName”).value

//then you could save the opener

opener.document.forms[0].submit()

//then close the popup

window.close()

Subject: RE: how to close popup and save document in the same time

thanks joe. But I don’t get the idea of the updating opener. I just want to save popup info. into a document itself, then close the popup. The informtion in popup won’t be part of parent doc.

I even tried setTimeout function to allow enough submit duration then close the window, but setTimout seems not running. I just get “form processed” in the popup. popup is never closed.

.submit();

top.window.setTimeout(‘window.close()’,1000)

anyone can help?

Subject: RE: how to close popup and save document in the same time

I missunderstood the question.

  1. on the popup form create a Computed for Disp field named $$Return - for its formula enter this “{{}}” - *Replace the curly brackets with square brackets

  2. on your button for the popup form just submit as normal

Subject: RE: how to close popup and save document in the same time

Joe, thanks a lot. a quick question for the formula. Why do we need double square brackets around the html tags. Is there any documetnation I could reference on how to put javasript in formula? thanks again.

Subject: RE: how to close popup and save document in the same time

As I understand it (or not) it tells domino its an internal redirection vs external. With a single square bracket (ext) domino uses a “post” to send your form, the server receives/processes and sends the url back to browser, the browser then uses the returned url in a “get” request back to the server. Two square brackets tells domino on the “post” that its an interal re-direct so domino sends the “page” back to browser instead of the URL.

I’m not aware of any doc for that, you may want to look at codestore.net - alot of great domino/web articles / examples.

Subject: RE: how to close popup and save document in the same time

Joe, another question for you:

I enter values into some fields in the popup window, how can I pass these fields value back to the opener window, save the document in popup and close the popup window automatically?