wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes How to get back in old window from a new window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to get back in old window from a new window " Watch "How to get back in old window from a new window " New topic
Author

How to get back in old window from a new window

Abhra Kar
Ranch Hand

Joined: May 22, 2008
Posts: 122
Hi,
I have a index.jsp-------

<html>
<head>
<script type="text/javascript">
function myfunc(){
var fname=document.getElementById("fname");
var lname=document.getElementById("lname");
window.open("result1.jsp?fname="+fname.value+"&lname="+lname.value,"mywindow","width=200,height=200");
}
</script>
</head>
<body>

<form name="form1">
First Name:
<input type="text" name="fname" id="fname" />

Last Name:
<input type="text" name="lname" id="lname" />

<input type="button" value="click here" onclick="myfunc()" />
</form>
</body>
</html>


and result1.jsp---------

<html>
<body>
<form>
<input type="text" name="credential" value="${param.fname}" />
<input type="hidden" name="lastname" value="${param.lname}" />
<input type="password" name="password"/>
<input type="submit" value="click it" />
</form>
</body>
</html>


Now I want when i click the submit button control goes back to old index.jsp(not in this new window) page
how i can do that.
any body id concept is present?
please guide me
thanks in advance
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1


If you were to call a window.close() in the new window that pops up you could close that.
Abhra Kar
Ranch Hand

Joined: May 22, 2008
Posts: 122
Thanks

But i want to go back to the old window from this new window .I don't want only close the new window
i want to access the "credential" and "password" from result1.jsp in the old index.jsp
How it will be possible ?please suggest
thanks
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
To set focus to the new window:



Eric
Abhra Kar
Ranch Hand

Joined: May 22, 2008
Posts: 122
I have solve my problem with your help
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get back in old window from a new window