Calling a Function From Another Page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • evanburen@gmail.com

    Calling a Function From Another Page

    I have an iframe inside of a parent page. How do I call the onChange
    function in the parent page from the ddlProfileNames dropdown in the
    iframe page?
    Thanks.

    code in parent page:

    <SCRIPT>
    function ordering(sorder )
    {
    // first, hide all the divs
    for ( var d = 1; d <= 16; ++d )
    document.getEle mentById("DIV"+ d).style.displa y = "none";

    // then, find where the first DIV is going to go:
    var node = document.getEle mentById("HERE" );
    var x = 0;
    var y = 0;
    while ( node != null )
    {
    x += node.offsetLeft ;
    y += node.offsetTop;
    node = node.offsetPare nt;
    }
    var ord = sorder.split(", ");
    for ( var o = 0; o < ord.length; ++o )
    {
    var dv = document.getEle mentById(ord[o]);
    dv.style.left = x;
    dv.style.top = y;
    dv.style.displa y = "block";
    y += dv.scrollHeight + 8; // 8 to account for 4px border
    }
    }

    // start things off:
    ordering("Div1, Div2,Div3,Div4, Div5,Div6,Div7, Div8,Div9,Div10 ,Div11,Div12,Di v13,Div14,Div15 ,Div16");


    </SCRIPT>




    code in iframe:

    <FORM name="frmProfil eNames">
    <SELECT class="smalltex t" id="ddlProfileN ames"
    onChange="order ing(this.option s[this.selectedIn dex].value);">
    <option value="value1"> value1</option>
    </SELECT>
    </FORM>

  • UnaCoder

    #2
    Re: Calling a Function From Another Page

    parent.Function Name();

    Comment

    Working...