Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] (no subject)


  • From: javascript@xxxxxxxxxx (charlie_chan)
  • Subject: [Javascript] (no subject)
  • Date: Wed, 11 Dec 2002 12:07:29 -0600

I am confused about this code.  I do not see any thing that creates a form
on the Javascript created page.  It would look like:
popPgWin.document.write('<form>') & popPgWin.document.wrte('</form>') to
open and close a form created with JavaScript.

----- Original Message -----
From: "Larry Cotton" <laurence.cotton@xxxxxxxxxxxx>
To: <javascript@xxxxxxxxxx>
Sent: Wednesday, December 11, 2002 11:23 AM
Subject: [Javascript] (no subject)


> Hi
>
> I'm attempting to update some information in a form using an external
> reference to a window opened using the open() method.
>
> My test scripts look something like (deb_prn simply writes to a debug
window) :
>
> WinOpTst.htm - file containing the code to open the window
> ----------------------
> <script language="javascript" type="text/javascript"><!--
> var popPgWin = window.open("popPgTst.htm", "PopPgTst");
>
> deb_prn("popPgWin.document.forms.length = " +
popPgWin.document.forms.length);
> deb_prn("popPgWin.document.forms[0].name = " +
> popPgWin.document.forms[0].name);
> deb_prn("popPgWin.document.forms.length = " +
popPgWin.document.forms.length);
> deb_prn("popPgWin.document.forms.TextBox1.value = " +
> popPgWin.document.forms.form1.TextBox1.value);
>
> //--></script>
>
> popPgTst.htm
> ----------------------
> <body>
> <form name="form1">
> <input type="text" name="TextBox1" value="Hello" size="20"></input>
> </form>
> </body>
>
> When I open WinOpTst.htm in IE 5 the output I get is :
> popPgWin.document.forms.length = 0
> popPgWin.document.forms[0].name = form1
> popPgWin.document.forms.length = 1
> popPgWin.document.forms.TextBox1.value = Hello
>
>     ... which is almost what I expect, except for some reason the length
of
> forms[] returns 0 until the form itself has been accessed.
>
> When I open it in Netscape 7.0 the output is :
> popPgWin.document.forms.length = 0
>
> and there is an error message saying ' popPgWin.document.forms[0] has no
> properties'
>
> Does anyone know what is going on here and how I can access the form in
> Netscape ?
>
> Cheers
> Larry
>
>
>
> _______________________________________________
> Javascript mailing list
> Javascript@xxxxxxxxxx
> https://lists.LaTech.edu/mailman/listinfo/javascript