1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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

Discussion in 'JavaScript' started by dr_pompeii, Feb 17, 2007.

  1. #1
    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;
    
    Code (markup):
    well this doesnt work
    now if the element is a textinput how
    
    <input type="text" name="[b]somename[/b]" value=""  id="[b]someid[/b]"/>
    
    Code (markup):
    i can use this to avoid the problem
    
    window.opener.document["nameForm"].[b]somename[/b].value;
    
    Code (markup):
    now the problem is this
    
    <span name="othersomename" id="othersomenid" style="display:none;">
        <h1>some data</h1>
                    ...
    </span>
    
    Code (markup):
    with span the name property is ignored
    so if i use this
    
        window.opener.document["nameForm"].othersomename.style.display="";
    
    Code (markup):
    i recive the error message
    window.opener.document.nameForm.othersomename has no properties
    or
    
    window.opener.document["nameForm"].getElementById("othersomenid").style.display="";
    
    Code (markup):
    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
     
    dr_pompeii, Feb 17, 2007 IP
  2. pushkar

    pushkar Peon

    Messages:
    125
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use
     window.opener.formname.getElementById("someid").value;
    Code (markup):
    Like window.opener.myfrm.getElementById("firstdiv").value
    
     window.opener.document["nameForm"].getElementById("someid").value;
     
    Code (markup):
     
    pushkar, Feb 19, 2007 IP