By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,627 Members | 1,682 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,627 IT Pros & Developers. It's quick & easy.

Parent window and other problem

P: n/a
Hello all!

Is there anybody who could help me. I have rewritten a code straigth from
the
book including a little bti of modifications, but unfortunately this code
doesn`t work.
I would like to create a main window, where after clicking on the button,
there
will be opened second window, where I will fill some string and after
clicking on
the ENTER key, this name value would be sent to the main window.
Where is the error in the following codes?

Thank you in advance
Marcin from Poland

----------------------------------------------------
parent window:

<HTML>
<HEAD>
<SCRIPT Language=JavaScript type="text/Javascript">

function otworz()
{
newWindow=window.open('JavaScript_okno_potomne.htm l','noweOkno','toolbar=yes
,location=yes,scrollbars=yes,width=300,height=200' );
}

</SCRIPT>
</HEAD>

<BODY>
<H1>Witamy na stronie</H1>
<FORM name=formularzWy>
<INPUT type=text size=20 name="tekstPowitanie" value="">
<INPUT type=button name=kliczek onClick="otworz();" value="">
</FORM>

</BODY>
</HTML>
----------------------------------------------------
second window:

<HTML>
<HEAD>

<SCRIPT Language=JavaScript type="text/Javascript">

function aktualizujParent(TwojeImie)
{
opener.document.formularzWy.tekstPowitanie.value=t wojeImie.value;
}
</SCRIPT>

</HEAD>

<BODY>
<H1> Jak masz na imie?</H1>
<FORM>
<INPUT name="twojeImie" type=text onBlur="aktualizujParent(this);" size=20>
</FORM>

</BODY>
</HTML>

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I have fix the problem myself.
Here is a right code including some idea modyfications:

second window
<HTML>
<HEAD>

<SCRIPT Language=JavaScript type="text/Javascript">

function aktualizujParent()
{
opener.document.formularzWy.tekstPowitanie.value=d ocument.forms('formularzyk
').elements('Klawisz').value;
}
</SCRIPT>

</HEAD>

<BODY>
<H1> Jak masz na imie?</H1>
<FORM name=formularzyk>
<INPUT type="text" name="Klawisz" size=20>
<INPUT type="button" name="cos" onClick="aktualizujParent()"
value="Przeslij">
</FORM>

</BODY>
</HTML>

----------------------------------------------------------------------------
----
parent window:

<HTML>
<HEAD>
<SCRIPT Language=JavaScript type="text/Javascript">

function otworz()
{
newWindow=window.open('JavaScript_okno_potomne.htm l','noweOkno','toolbar=yes
,location=yes,scrollbars=yes,width=300,height=200' );
}

</SCRIPT>
</HEAD>

<BODY>
<H1>Witamy na stronie</H1>
<FORM name=formularzWy>
<INPUT type=text size=20 name="tekstPowitanie" value="">
<INPUT type=button name=kliczek onClick="otworz();" value="">
</FORM>

</BODY>
</HTML>
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.