Calling a Function From Another Page

E

evanburen

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.getElementById("DIV"+d).style.display = "none";

// then, find where the first DIV is going to go:
var node = document.getElementById("HERE");
var x = 0;
var y = 0;
while ( node != null )
{
x += node.offsetLeft;
y += node.offsetTop;
node = node.offsetParent;
}
var ord = sorder.split(",");
for ( var o = 0; o < ord.length; ++o )
{
var dv = document.getElementById(ord[o]);
dv.style.left = x;
dv.style.top = y;
dv.style.display = "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,Div13,Div14,Div15,Div16");


</SCRIPT>




code in iframe:

<FORM name="frmProfileNames">
<SELECT class="smalltext" id="ddlProfileNames"
onChange="ordering(this.options[this.selectedIndex].value);">
<option value="value1">value1</option>
</SELECT>
</FORM>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top