By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,776 Members | 1,400 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,776 IT Pros & Developers. It's quick & easy.

frame hierarchy question...

P: n/a
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
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Mel wrote:
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
Jul 23 '05 #2

P: n/a
Mick White wrote:
Mel wrote:
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

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.