...

View Full Version : parent frames



Kevin
03-02-2003, 10:56 PM
passing info from one frame to another

can you take alook and advise on what I am missing...

http://voyager.deanza.fhda.edu/~kkr42797/framesNforms_2.html

code from parent frame

function ExchangeTop(form)
{
comFraB.form.getTextTop.value = comFraA.document.forms.sendTextTop.value;
} /* end ExchangeTop() */

function ExchangeBottom (form)
{
comFraA.form.getTextBot.value = comFraB.document.forms.sendTextBot.value;
} /* end exchangeBottom() */

Calls from child frames fraA and fraB
fraA =
onblur="parent.ExchangeTop(this.form);"

fraB=
onblur="parent.ExchangeBottom(this.form);"

insight always appreciated
thank you
Kevin :thumbsup:

glenngv
03-03-2003, 12:35 AM
since you passed the form handle to the function, you can use it directly like:

function ExchangeTop(f)
{
top.frames['comFraB'].document.formNameOfFrameB.getTextTop.value = f.sendTextTop.value;
} /* end ExchangeTop() */

function ExchangeBottom (f)
{
top.frames['comFraA'].document.formNameOfFrameA.getTextBot.value = f.sendTextBot.value;
} /* end exchangeBottom

i suggest you change the parameter name form to something else, it might conflict with the form property of html controls.

Kevin
03-03-2003, 02:01 AM
I appreciate the help

I forgot that I needed to name the forms for each frame and then pass that....

Thank You
Kevin :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum