Can someone help me to close a web prompt window?

Ok, simple task… prompt the user with an embedded view of choices, save their selection in the parent form and then close the prompt window. Nothing too serious. In fact, I’ve done it before in another app, so I simply copied the code thinking it would work again. NOT! This is the code in my OK button (hotspot action) of the prompt form:

var selectField = window.document.forms[0].docs;

var targetForm = window.opener.document.forms[0];

var result = “x”;

for (var i=0; i<docs.length; i++)

if (docs[i].checked)

{

    var result = docs[i].value;

}

values = result.split(‘~’);

targetForm.CustName.value = values[0];

targetForm.CompNo.value = values[1];

targetForm.Address.value = values[2];

targetForm.City.value = values[3];

targetForm.State.value = values[4];

targetForm.Zip.value = values[5];

targetForm.Country.value = values[6];

targetForm.Phone.value = values[7];

targetForm.Fax.value = values[8];

targetForm.AcctMgr.value = values[9];

targetForm.CSR.value = values[10];

targetForm.CustUNID.value = values[11];

//window.close();

//top.window.opener=“x”;

//top.window.close();

//self.opener = this;

//self.close();

//frm = document.forms[0];

//frm.submit();

//window.close();

//dbpath = frm.BASFileFwd.value;

//window.open(“/”+dbpath+“/wCloseEvent?OpenForm”,“Close”)

As you can see, I’ve tried everything I can think of to close that $%@#% prompt window, but nothing works. The prompt window contents return to the opening frameset for the embedded view db. In fact, even now, with all closing commands commented out, it will still bring up the opening frameset in the prompt window. It’s driving me nuts.

In my Cancel button (hotspot action), I have window.close(); and it works perfectly.

What am I missing? Why does the Ok code above still continue to return me to the opening frameset? I’ve tried clearing I.E. history and it still does it.

Any ideas?

Bob

Subject: Can someone help me to close a web prompt window?

Maybe there was something wrong with sending the values back to parent doc?

This is a similar function from a very stable application which does practically the same - in a popup, it has embedded view from another DB, user selects some of them, it sends values from it to the opener and closes the popup. Changed the code to descriptions because it is not mine etc…

function ok_click() {

… here the code gets the values that user selected and assigns to the variable …

if (.(, ))

{

window.close();

};

}

As you can see, it has the part of the code that sends data to the opener, in separate function. It tests if the function ran OK, then uses plain old window.close()

Subject: Can someone help me to close a web prompt window?

Hmmm. Really interesting.Random idea: where is the focus? Make sure the focus is on the popup when calling window.close()

Subject: RE: Can someone help me to close a web prompt window?

Yes, the Ok button is in the prompt window. The content of the prompt window is a form from another db, which displays an embedded view from that db.