homepage Welcome to WebmasterWorld Guest from 54.227.56.174
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
get back the values to main window from popup window
This is very urgent
sonu




msg:1495335
 6:42 am on Mar 3, 2005 (gmt 0)

Hi,

I have a jsp page main.jsp by which i open popup window popup1.jsp which has a text box and a button(search) which open a another window popup2.jsp and close popup1.jsp. On popup2.jsp we have a selection box and we select a value from that and press the button Ok .
I want when we press ok then the selected value is get back to main.jsp and insert a row for that on main.jsp and popup2.jsp is close. when we do it again then we again add new row for selected value and last selected value is as it is.

can any one help me
it is very urgent.

Thanks Shalendra

 

SpaceFrog




msg:1495336
 3:53 pm on Mar 3, 2005 (gmt 0)

Try this

Main page:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Opener</title>
<script type='text/javascript'>
function valideopenerform(){
var popy= window.open('popup.htm','popup_form','menubar=no,status=no,top=100%,left=100;')
alert (popy.window.document.URL);
}
</script>
</head>

<body>
<form name='openerform' id='openerform' >
<input type='text' id='text1' name='text1' />
<input type='button' value='go' onclick='valideopenerform()' />
</form>

</body>

</html>

Popup:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Opener</title>
<script type='text/javascript'>
function validepopupform(){
window.opener.document.openerform.text1.value=document.popupform.text2.value;
self.close();
}
</script>

</head>

<body>
<form id='popupform' name='popupform' >
<input type='text' id='text2' name='text2' />
<input type='button' value='go' onclick='validepopupform()' />
</form>

</body>

</html>

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved