Close browser window and redirect

I have a page that opens a browser window, it displays a form that the user fills out.  When the user finishes they simply click the upper right corner of the window to close it. The problem is when they do that I need for the main page which has the link to open it to REFRESH. Because when they save the form displayed in the pop up an entry is made in the database and if they want to open it again the main page needs to be refreshed to pass on the new parameter.

How can I close the pop up window AND refresh my main page when they do ?
LVL 1
AleksAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

arnoldCommented:
Do you use Ajax/Jason?
Does your form page include a submit which you can use to record the data, close the window (some will be promoted to confirm) and in change the main page will refresh.
AleksAuthor Commented:
The forms code is generated by a provider, so I cannot touch it. We can however configure adding buttons. I can add a button with javascript that would close the window and then refresh the parent window.
IF I do this I need to take out the "X" close button of the browser window, otherwise user might click on that and adding a button has no purpose.
arnoldCommented:
my guess the user hits close, because there is no other option there.
You could add JavaScript validation that triggers the submit when all the form fields are filled in. I.e. Each field onChange trigger a check to see whether the form is complete. Providing the user with a submit button will remove the need of the user closing the window by them selves. Also when you open a separate window, your main page could keep /detect the event when the window is closed.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

AleksAuthor Commented:
That wouldn't work. Saving the form doesn't mean the user is done with the form, forms can be 20 pages long so they fill one page or a few fields and then save it.
when they CLOSE the form then that is when it should close and refresh the parent page.
arnoldCommented:
You can look at the example dealing with opening a new window while handling the close event.

http://www.javascript-coder.com/window-popup/javascript-window-open.phtml
The examples pops a notice to the user, a similar mechanism could be a response to the parent page who opened the window to refresh.

The open window you will have onSubmit do things, then window.close.
.

Test out a parent that opens a window, then displays the window closed in the parent window.
AleksAuthor Commented:
Thanks you. This might be useful. I will read it tomorrow.
arnoldCommented:
If there form/data collection spans 20 pages, presumably each stage is saved, while the data is built-up.............

Handling of the data collection............
AleksAuthor Commented:
nop. they save whenever they want. they could save after entering two fields or 10, its up to the user to decide when they want to save their work.
arnoldCommented:
W'll resume this after you review the example.  Understanding  the process used in the form/data collection could help I.e. When a firm field is updated, it is reported back to the server and saved......
Tge user can terminate their entry when they want and can resume it in the same way.  Does the main page track how far along the person is?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AleksAuthor Commented:
We are trying a different approach.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.