We help IT Professionals succeed at work.

AJAX Refresh on Submit of Pop Up Window

cortdev
cortdev asked
on
Hello Experts,

I have a question, by any chance do you guys know how to do the following:

- I will need to submit a form which is located in a pop up window opened from a parent window.
- After the form is submitted this pop up needs to close
- After the pop up is closed the parent window needs to be refreshed.

Please advice, thanks!!
Comment
Watch Question

Senior Software Engineer
Commented:
Hai,

"opener.document.formname.refresh();"

when using this above code in your script,will help you to refresh parent window after you close the pop up window

Thanks
leakim971Multitechnician
Distinguished Expert 2019

Commented:
Check this :


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript">
	var microsoft = null;
	function openChild() {
		microsoft = window.open("http://www.google.com",'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=800,height=600,screenX=150,screenY=150,top=150,left=150');
		test();
	}
	function test() {
		setTimeout("test();",300);
		if(microsoft.closed) { 
			alert("reloading!!!");
			document.location.reload(true);
		}
	}
</script>
</head>
<body>
<input type="button" onclick="openChild();" value="Open Child" />
</body>
</html>

Open in new window