This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one for details.
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
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply 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: 112
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: 434


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: 112
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: 15357
    
    6
To set focus to the new window:



Eric
Abhra Kar
Ranch Hand

Joined: May 22, 2008
Posts: 112
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
 
Similar Threads
can we put HTML input tag with in <form:form> </form:form>?
How to remove Textbox Element using DOM in HTML
recod is not inserting in mysql databse
Is onSubmit() mandatory to write when SimpleFormController is used?
How to rendar data from new window to old window through window.focus() ? Or any other way.