Hi, how do I do to make a page wait for a popup to close before continuing the loading of the main page?
Thanks
Printable View
Hi, how do I do to make a page wait for a popup to close before continuing the loading of the main page?
Thanks
What are you trying to accomplish that requires the page to wait for a popup to close?
What I'm trying to do is the following. I have a web page so the user can enter some informations. When he click on " Apply" I must check if a specific field is empty, if yes I must open a popup that contain a list and a ok button that return the choice on the list. So I need that the main page wait for the popup to close before continuing the loading.
You should probably use RequiredFieldValidator control if you have data that is required before continuing.
What if pop-up it self Load the Main page and close it self after passing value?
'code on pop-up page when "Apply" is clickedCode:Dim strScript As String
strScript = "<script language=javascript> "
strScript &= " window.opener.Form1.txtTest.value = 'Info';"
strScript &= " window.opener.document.forms(0).submit();"
strScript &= " window.close();"
strScript &= " </script>"
Response.Write(strScript)
You can use a customvalidator or just a custom javascript function which you run in the onsubmit for the <form>. Have it return false if the field is empty. Then, within the same method, call the window.open(). This way, the form won't submit, but it will open the popup window you wanted. The user will need to select something and then click on the submit button again.