frame hierarchy question...

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

    frame hierarchy question...

    i have the following code that does not work:

    parent.frames["B"].document.forms["CMND"].elements.["id"].disabled=true;

    i have 3 iframes in my main T (top), M (middle) and B (bottom)

    in the bottom, i have a form (CMND) with an entry field (id) that i would
    like to enable disable at will.

    i am executing above script from inside "B". why does that not work ?

    thanks for your help


  • Mick White

    #2
    Re: frame hierarchy question...

    Mel wrote:
    [color=blue]
    > i have the following code that does not work:
    >
    > parent.frames["B"].document.forms["CMND"].elements.["id"].disabled=true;
    >
    > i have 3 iframes in my main T (top), M (middle) and B (bottom)
    >
    > in the bottom, i have a form (CMND) with an entry field (id) that i would
    > like to enable disable at will.
    >
    > i am executing above script from inside "B". why does that not work ?
    >[/color]

    Two things:
    "id" is a reserved word, I would use something else ("idee"?).
    Your reference is faulty.

    parent.frames["B"].document.forms["CMND"].elements["idee"].disabled=true

    Note no dot between elements and ["idee"]

    Mick

    Comment

    • Mick White

      #3
      Re: frame hierarchy question...

      Mick White wrote:
      [color=blue]
      > Mel wrote:
      >[color=green]
      >> i have the following code that does not work:
      >>
      >>
      >> parent.frames["B"].document.forms["CMND"].elements.["id"].disabled=true;
      >>
      >> i have 3 iframes in my main T (top), M (middle) and B (bottom)
      >>
      >> in the bottom, i have a form (CMND) with an entry field (id) that i
      >> would like to enable disable at will.
      >>
      >> i am executing above script from inside "B". why does that not work ?[/color][/color]

      Oops, I just noticed, in this case the form "CMND" is in the same frame
      as the javascript assignment, there is no need to traverse the frame
      heirarchy :
      document.forms["CMND"].elements["idee"].disabled=true;

      Mick

      [color=blue]
      >
      > Two things:
      > "id" is a reserved word, I would use something else ("idee"?).
      > Your reference is faulty.
      >
      > parent.frames["B"].document.forms["CMND"].elements["idee"].disabled=true
      >
      > Note no dot between elements and ["idee"]
      >
      > Mick[/color]

      Comment

      Working...