The issue is: Form2 does not have access to the Form1
DOM -- so
document.getElementById("button1") is null when
executed in Form2.
If you put a try/catch block in doIt2(), you will see
that.

One possibility is: in window.open(...) in Form1, pass

document.getElementById("button1").value to Form2,
i.e.,

function doIt()
{
window.open("chrome://plugin/content/Form2.xul",
"form2",
"chrome,
width=350,height=120,centerscreen",
document.getElementById("button1").value);
}

Then in Form2's xul, onload="form2Init();" > or onload="form2Init();" >
i.e., add the onload=... if you don't already have
one.

Define a semi-global variable gArg1 available to
Form2's javascript, and initialize
it in form2Init():
if ( window.arguments && window.arguments[0])
gArg1 = window.arguments[0];

gArg1 has document.getElementById("button1").value
that you passed from Form1 window.

function doIt2()
{
if (gArg1)
document.getElementById("button2").value = gArg1;
}

Cheers,
AM




--- Keller Kind wrote:

> Hello,
> i have got the following Problem:
>
> I have got two Formulars written in XUL and one
> JavaScript- File
>
> *Form1.xul:*
> ....
> > ...
>