hi
i have a html page when the user clicks a button in the parent window a popup window will be opened which will contain the login page.if the user is a valid user then i want the parent window to get refreshed so that i can show him the next page
thanks

Recommended Answers

All 8 Replies

i want to refresh the parent window by opening another page on the parent window

Yep.. Thats what window.opener will do..

Thanks for ur reply
i have attached the code with this reply

1st page frames.html

<HTML>
<HEAD></HEAD>
<FRAMESET ROWS="15%,*" BORDERCOLOR="#999999" BORDER="1">
          <FRAME SRC="http://jesus.freehyperspace2.com/page.html">

     
          <FRAME src="http://jesus.freehyperspace2.com/page.html">
</FRAMESET>
</HTML>

2nd page ..page.html

<html><head>

<SCRIPT language=JavaScript>
<!-- 
function nim(){
myWindow=window.open("http://jesus.freehyperspace2.com/child2.html","MyName","width=500,height=500")

//-->
}
</SCRIPT>


</head>
<body>
<input type="submit" onClick="nim();"
value="Open Window"> 
</body>
</html>

3rd page...child2.html

<html>
<head>
<title>(Type a title for your page here)</title>

<SCRIPT language=JavaScript>
<!-- 
function win()
{

window.opener.location.href="http://jesus.freehyperspace2.com/desc.html";
self.close();
//-->
}
</SCRIPT>
</head>
<body bgcolor="#ffffff" >

<font face='Verdana' size='2' >This is the child window opened . Click the button below to close this window and refresh the main window</font>
<br><br>
<center><input type="submit" onClick="win();" value="Close this window"></center>

</body> 
</html>

when i click the popup window i want to refresh the parent window and display as a whole page but in my application the output is coming in the first frame alone

Here is a simple example.
This is test.php

<html>
<head>
<script type="text/javascript">
function popup(){
	window.open("popup.php","100","100");
}
</script>
</head>
<body>
<form name="test">
<a href="#" onclick="javascript:popup();">Login</a>
</form>
</body>
</html>

And this is the popup.

<html>
<head>
<?php
if(isset($_POST['submit'])){
if($_POST['name'] == "test") {
	echo "<script type='text/javascript'>window.opener.location='test2.php'</script>";
} else {
	echo "<script type='text/javascript'>window.opener.location='http://www.google.com'</script>";
}
}
?>
</head>
<body>
<form method="post" action="popup.php">
Name: <input type="text" name="name"><br />
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>

In the popup, if the user inputs name as test, it will redirect the parent window to test2.php and if its wrong, it will redirect to google.com :)
Cheers,
Naveen

hi
thanks for the reply.tat part is working for me

click to see my output
http://jesus.freehyperspace2.com/frames.html

i have a page to display welcome...since i am using frames it is getting displayed in a particular frame but i want the output in full window .the whole window should be dericted to this window

:) Cool !

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.