Welcome to WebmasterWorld Guest from 54.205.20.160

Forum Moderators: open

Message Too Old, No Replies

get back the values to main window from popup window

This is very urgent

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

5+ Year Member



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

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

10+ Year Member



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>

 

Featured Threads

Hot Threads This Week

Hot Threads This Month