469,898 Members | 1,620 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

How to get the values in the opening window?

i hav a window wit a button and text box..
Then am opening a new window...
suppose if i type somethin in a first window's text box.. and click the button..
the value typed in the text box shoult appear in the opening window...
Is it possible

<html>
<body>
<script type = "text/javascript">
function fun1 ( )
{
var i = document.getElementById("text1").value;
newWindow = open ( "test.html ", "Window");
newWindow.document.writeln("<input type = 'button' name = 'button1' value = 'click'>");
newWindow.document.writeln("<input type = 'text' id = 'text1' name = 'txt1'>");

}
</script>
<form name = "form">

<input type = "button" name = "but1" value = "click" onclick = "fun1 ( )">

<input type = "text" id = "text1" name = "text1" >

</form>
</body>
</html>
Apr 1 '08 #1
1 1198
pronerd
392 Expert 256MB
suppose if i type somethin in a first window's text box.. and click the button.. the value typed in the text box shoult appear in the opening window...
Is it possible
Yes.


[HTML]
<html>
<body>
<script type = "text/javascript">
function fun1 ( )
{
var i = document.getElementById("text1").value;
newWindow = open ( "test.html ", "Window");
newWindow.document.writeln("<input type = 'button' name = 'button1' value = 'click'>");
newWindow.document.writeln("<input type = 'text' id = 'text1' name = 'txt1' value='"+i+"' >");

}
</script>
<form name = "form">

<input type = "button" name = "but1" value = "click" onclick = "fun1 ( )">

<input type = "text" id = "text1" name = "text1" >

</form>
</body>
</html>[/HTML]
Apr 1 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

14 posts views Thread by D. Alvarado | last post: by
reply views Thread by bbrewder | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.