Forum Moderators: open
Thanks,
:: CHESKO ::
I have found the following... the code that opens the popup is something like:
function listItems(temp){
// ..... more code goes here ....
mytext = mytext + "</ol><center><a href='javascript:self.close();'>close</a></center><BR>";
linkswin = window.open(window.location,'',windowprops);
// If I add this ALERT it works fine... why?
alert(self.name);
linkswin.focus();
linkswin.opener = window;
linkswin.opener.name = self.name;
mypopup= myheader + myfont + mytext + myendfont + myendheader;
with (linkswin.document) {
open();
write(mypopup);
close();
}
}
// end -->
Thanks so much...
Welcome to WebmasterWorld,
I'm a little baffled as to exactly what's going wrong for you but I just scanned your code and the following lines seem to me to be unnecessary...
linkswin.focus();
linkswin.opener = window;
linkswin.opener.name = self.name;
Since the linkswin window is being opened by the same script the linkswin.opener object should automatically be configured to point to the window running the script and therefore shouldn't need assigning to...
I tried the code and it worked fine without those lines. As I say, I'm not entirely clear what's going wrong.
Let me know if I'm wandering down the wrong track.
Josh
as you where pointing out, those lines where not needed. But even deleting those lines out of the code, I continue having the same problem.
- I fill the form (opener).
- Click on a button which calls the child window.
- Select a value which will go into a field in the opener form.
- The child window self closes.
- Click on the submit button (opener).
- A in-between page is called for password verification.
- If password no good then history.back() to opener with all fields with the data entered.
Supposedly, when history.back() the fields in the opener should remain as they were left (this is filled out with the same data).
If I do not call the child window prior to submitting the form then history.back() works fine, mantaining all data as it was.
If I call the child window, select the value, close the child, submit the form, and password no good, then as history.back() data is lost....
It would work, if in the child window I add an alert(something) in between the code, prior to document.write as stated in my second response... Seems like child window should completely load or something like that... :-?
Thanks again,
:: CHESKO ::
When a browser is entered into the history the form entries (with the exception) should also be stored so that when you go back the form was as you (or script even) left it.
What exactly is the child (opened) window doing with the form in the parent (opener) window?
Also...
- A in-between page is called for password verification.
If so have you considered posting to the same page that runs conditional code (if it's at the receiving end of the form post) that checks the validity of the password and if that fails repopulates the form fields on the server (therefore not relying on the browser's back) - this is the most common way this stuff is done.