PDA

View Full Version : How do i open new window



pkvasan
Sep 17th, 2007, 04:35 PM
Hi
I am doing an program to store order details from Internet.My users enters all the required values in the text boxes provided in the html page. onee he clicks confirm order i wanted the details to be displayed in another window in nicely formated way with all the details he entered.

Now iam stuck up here on opening a new window and showing the details of the values entered. I tried doing it in java script but no result.

can any one help me on guiding how to go about it

Thanks

Fang
Sep 17th, 2007, 04:47 PM
window.open (http://developer.mozilla.org/en/docs/DOM:window.open)
You need to show the parent and child documents contain.

pkvasan
Sep 17th, 2007, 05:04 PM
here are the codes
Parent Document
<script language="JavaScript">
<!--
function newWindow(file,window)
{
msgWindow=open(file,window,'resizable=no,width=200,height=400');
if (msgWindow.opener == null)
{
msgWindow.opener = self;
}
}

<body>
<form name="form1" onsubmit="javascript:newWindow('new_screen.php','window2')">
<input type = "text" name="fname">
<input type = "text" name="lname">
<input type = "submit" name="porcess">
</form>

Child Window

<script type="text/javascript">
<!--
String fname=request.getParameter("firstName");
String lname=request.getParameter("lastName");
out.print("welcome"+fname+ lname);
</script>

Fang
Sep 17th, 2007, 05:19 PM
Child window:
<script type="text/javascript">
window.onload=function(){
alert(opener.document.form1.fname.value+":"+opener.document.form1.lname.value);
};
</script>