how to pass parameter from parent window to popup window

ex1.jsp

--

<html>

<head>

<script language="javascript">

function popup(url)

{

var win_dow;

win_dow = window.open(url,"name","height=330,width=635,scrollbars=yes");

}

<script>

</head>

<body>

<input type="text" name="firstname">

<input type="text" name="lastname">

<input type="text" name="address">

<input type="text" name="zipcode">

<a href="javascript:popup("ex2.jsp");">view</a>

</body>

</html>

I short I want that all text value should be displayed in popwindow i.e in ex2.jsp

[692 byte] By [kumarvermaa] at [2007-10-2 14:42:15]
# 1

Try something like this:

<html>

<head>

<script language="javascript">

function popup(url)

{

var win_dow = window.open("","myPopUp","height=330,width=635,scrollbars=yes");

document.forms[0].action = url;

document.forms[0].submit();

}

</script>

</head>

<body>

<form action="" method="post" target="myPopUp">

<input type="text" name="firstname">

<input type="text" name="lastname">

<input type="text" name="address">

<input type="text" name="zipcode">

</form>

<a href="javascript:popup('ex2.jsp');">view</a>

</body>

</html>

You could also set the form action to "ex2.jsp" and then not do it in the function. Similarly, you could set the target in the function. The target name must match the name you specify in the window.open(). Don't specify a url in the window.open(). By the way, all your input fields must be within a form. Note also on the href, I used single quotes around ex2.jsp since the href is enclosed in doble quotes.

Gita_Weinera at 2007-7-13 13:12:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...