frame hierarchy question...

M

Mel

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
 
M

Mick White

Mel said:
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 ?

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
 
M

Mick White

Mick said:
Mel said:
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 ?

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

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
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top