This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread 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


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: 114
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: 436


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



Eric
Abhra Kar
Ranch Hand

Joined: May 22, 2008
Posts: 114
I have solve my problem with your help
Thanks
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
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.