frames and forms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JoeBaker

    frames and forms

    i'm trying to use javascript to change the content of a textbox in a
    different frame.

    by clicking on a 'folder' link in 'leftFrame' i want to put the value
    assigned by that link into the 'folderName' textbox in the
    'uploadForm' form in 'mainFrame'. i'm doing this as...

    onClick="parent .mainFrame.uplo adForm.folderNa me.value='folde r';"

    this works perfectly fine with IE and Safari on my Mac OS X machine
    and IE 6 on my PC laptop but anything Mozilla-based on either machine
    gives me an error i just can't seem to get round...

    'parent.mainFra me.uploadForm has no properties'

    has anyone got any ideas why and what i can do about it, please?

    many thanks

    joe
  • Lasse Reichstein Nielsen

    #2
    Re: frames and forms

    jsbaker@btclick .com (JoeBaker) writes:
    [color=blue]
    > 'parent.mainFra me.uploadForm has no properties'[/color]
    [color=blue]
    > has anyone got any ideas why and what i can do about it, please?[/color]

    You use the name of the form as a global variable. There is no reason
    to believe that that should work, except that IE decided to allow it.
    Try the fully qualified path:

    parent.frames['mainFrame'].document.forms['uploadForm'].
    elements['folderName'].value = ...

    It is always safer to use the appropriate collections.

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    Working...