Find jobs - Rome hotels - Find services - Military Loans - Debt Consolidation

PDA

View Full Version : window.opener.document["nameForm"].getElementById("someid").value; doesnt work


dr_pompeii
Feb 17th 2007, 4:14 pm
Hello guys

i really need your help

i have a popup window, then when i finished (pressing submit button) call onSubmit
method of the form and then call some method in javascript (the js file is an external file) and use some sentence how this


window.opener.document["nameForm"].getElementById("someid").value;

well this doesnt work
now if the element is a textinput how

<input type="text" name="somename" value="" id="someid"/>

i can use this to avoid the problem

window.opener.document["nameForm"].somename.value;


now the problem is this

<span name="othersomename" id="othersomenid" style="display:none;">
<h1>some data</h1>
...
</span>

with span the name property is ignored
so if i use this

window.opener.document["nameForm"].othersomename.style.display="";

i recive the error message
window.opener.document.nameForm.othersomename has no properties
or

window.opener.document["nameForm"].getElementById("othersomenid").style.display="";

i recive this error message:
window.opener.document.nameForm.getElementById is not a function


pls, how i can resolve this???

thanks so much for advanced

BTW : i am using firefox 1.5.0.9 in linux

pushkar
Feb 19th 2007, 2:08 am
Use window.opener.formname.getElementById("someid").value;

Like window.opener.myfrm.getElementById("firstdiv").value

window.opener.document["nameForm"].getElementById("someid").value;