Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using child windows to add to database.

Status
Not open for further replies.

Geee

Programmer
Apr 23, 2001
253
0
0
GB
Has anyone successfully done this? IE clicking a hyperlink opens a new window with the form in it. You then fill the form in and click submit, which calls another window which has the asp validation and database stuff. Once you have put the record the page refreshes the main parent window and then closes itself. I can get do everything except for the last bit where you refresh the parent and close self. I think I need to use JavaScript, something like...

<script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;>
window.opener.refreshSelf();
window.close();
</script>

But im not sure. Any ideas? -GTM Consult, Home of USITE-
-=
 
I do not know how to solve your problem, but your problem seems to stem from the fact that you are popping up two windows so when you run the window.opener.refresh you are actually telling the first popup window to refresh and not the orginal parent window.

If you can do all your database stuff in one popup window then it might work.

Kris
 
No I am only spawning 1 popup. That is then submitting a form to the same poppup which then wants to refresh the parent window and close itself. -GTM Consult, Home of USITE-
-=
 
i did exactly that a few months ago in a scheduling app.

<Script type=&quot;text/Javascript&quot;>
function closeCall() {
window.opener.location.reload(true);
window.close(true);
}
function autoCall() {
setTimeout('closeCall()','500');
}
</script>
<body onLoad=&quot;autoCall();&quot;>

i had a form popup, process a form, then on this page it would update the database, clsoe the popup, and refresh the main window. perhaps the key is the timeout. worked pretty well for me, hope this helps.
good luck!
-jacob
 
This should work:

<script language=&quot;javascript&quot;>
opener.location.reload();
window.close();
</script>

good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top