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 ?
ASPWeb DevelopmentHTML
Last Comment
Aleks
8/22/2022 - Mon
arnold
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.
Aleks
ASKER
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.
arnold
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.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Aleks
ASKER
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.
arnold
You can look at the example dealing with opening a new window while handling the close event.
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
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.