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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

close pop-up window after submitting a form 2

Status
Not open for further replies.

deadfish

Programmer
Nov 13, 2002
50
0
0
HK
Hi, I have a pop-up, which gets user information and insert a record after user input values in the pop-up and click the "Add Record" button. I wrote the code like this:

document.form1.submit();
self.close();

I find that sometimes the user cannot insert record while sometimes it works fine (with the same data input).Is it possible that the "self.close" goes before the "submit" code so that it cannot get the data from the pop-up? Does the above code cause the problem? How to make sure the form is subbmitted before the pop-up close?

Thanks in advance!
 
mbrooks, that way will potentially work - however it leaves one subject to network or pc lag. The window could potentially close before submission has completed.

A more concrete solution would be to check if the page has been submitted server side and invoke the close function after the submitted page has completed loading. Or for a non-automated process like the way that red flags or awarding stars are handled - a "close window" link appears on the page after submission. Speaking of awarding stars......


A side note to deadfish: Your profile shows a small handful of questions asked here at TT with barely 1/2 as many replies to your own threads - and 0 tipmaster stars awarded to boot.

Remember that each individual that offers help here does it on their free time with no reward other than the gratitude that the original posters supply. For this reason it is common courtesy to at least drop back into a thread to say "thanks, that worked" or award a little purple star by clicking the "thank xxxxx for this valuable post"

-kaht

[small]How spicy would you like your chang sauce? Oh man... I have no idea what's goin' on right now...[/small]
[banghead]
 
Thank you very much for the reply. I will try the way like handling the "awarding stars".

Thanks kaht and I will remember to give a star to those helping me from now on. ;-)
 
Sounds good - I think a lot of users just never become aware of how the system works. Sometimes a polite nudge is all it takes [smile]

-kaht

[small]How spicy would you like your chang sauce? Oh man... I have no idea what's goin' on right now...[/small]
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top