Forum Moderators: open

Message Too Old, No Replies

Writing some inputs into a new window

How to do it?

         

mcibor

9:30 am on Apr 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a main window with lots of records and some inputs. After processing them I want to create a new popup window with processed text (it will be sth like: <input type="text" value="here processed value"><input type="submit">.

To say the truth I would really like sth like a "confirm" window with two buttons: proceed and cancel. Both of them need to close the window and proceed has to submit the window form as well.

How can I do that?

Looking for any answer (don't have much experience with new windows, never used them before).

Michal Cibor

PS. I use PHP to create the parent window.

orion_rus

9:25 am on Apr 10, 2005 (gmt 0)

10+ Year Member



Ok you have free ways.
First is to call window like
newwindow.php?line=true
and process like a common form.
Second is to make a content of new window with javascript.
like window.document.write('<html>');
window.document.write('<body>');
window.document.write('<input type="text" value="'+yourvalue+'" />'); and so on.
Third way is to create a window there javascript in it fills all input fields from opener source.
Choose your way) and we try to post code here
Good luck to you!

mcibor

12:02 pm on Apr 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks! I'll use the window.document.print method. Can you just tell me how to submit the original page on? parent.form.submit()? If not, then what?
Michal Cibor

mcibor

9:52 pm on Apr 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's not working;(

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Hello World</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-2" >
<script type="text/javascript" language="JavaScript">
<!--
function js_window()
{
window.open('#', 'win', 'width=400', 'height=200', 'menubar=no', 'directories=no', 'location=no', 'toolbar=no');
window.document.write('<html><head></head><body><p>I wrote sth</p></body></html>');
}
//-->
</script>
</head>
<body>
<button onclick="js_window(); return false;">Okno</button>
</body>
</html>

mcibor

9:54 pm on Apr 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The new window opens, but with original text, and the "I wrote..." appears in the old window. How to change the order? I want the text to appear in new window.

BTW the new text is never ending to fully load.

Any answer would be appreciated
Michal Cibor

Sorry for splitting this in two (I am unable to post this message as a one). If one of you guys can glue it I would appreciate.

OK. I found it!
it should be: mywindow = window.open(...);
mywindow.document.write(...);

Thanks!

Reboot

10:12 pm on Apr 15, 2005 (gmt 0)



function js_window()
{
var new_WIN = window.open ('', 'win', 'width=400,height=200,menubar=no,directories=no,location=no,toolbar=no');
with (new_WIN.document)
{
open ("text/html", "replace");
write ('<html><head></head><body><p>I wrote sth</p></body></html>');
close ();
}
}