473,387 Members | 1,318 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Why can't I access child frame elements with the direct form?

I have a document that contains a child frame with name/id = "help_frame".
From Javascript in the top level document I can access the child frame's
elements using:

var elem = document.frames.help_frame.document.getElementById ("chkSynonym");

but if I try:

var elem = document.frames.help_frame.document.chkSynonym;

the result is 'undefined'.

What is wrong with my syntax?

thx
Jul 20 '05 #1
1 7089
"Robert Oschler" <no_replies@fake_email_address.invalid> writes:
var elem = document.frames.help_frame.document.getElementById ("chkSynonym");
I believe it is more correct to use "window.frames...". E.g., Mozilla
doesn't have "document.frames".
but if I try:
var elem = document.frames.help_frame.document.chkSynonym;
the result is 'undefined'.

What is wrong with my syntax?


The syntax is fine. Maybe the browser simply doesn't make named
elements available as properties of the document element (or maybe
just not all of them). There is no standard that requires it to do so.

If getElementById works, use it.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stuart Wexler | last post by:
Let's say I have a frameset page and I want to preselect an option in a select box from the parent frame. So the parent frame would programmatically change the select box in the child frame. ...
1
by: ian.michel | last post by:
I have a parent window that pushes a new window object onto an Array with the following code : OpenChild() { //totalNumWindowsCreated is global totalNumWindowsCreated =...
1
by: Bill Strass | last post by:
I have a form showing the records of different people. I would like a photo to be displayed in the form, with each person's record. My digital photo > *.jpg type file and I change each photo...
2
by: authorking | last post by:
How to access a control in another form and how to make a form become a MDI container.
2
by: Jeff Cooper | last post by:
I have a form that has a button on it that can open a child form with the window.open(...) Javascript call. When the form is submitted, I'd like to close the child form, if it's opened. I have the...
3
by: awebguynow | last post by:
in other words, Can I make client side mod's before I submit a form and Post ? I guess its just a matter of cycling through the form elements and setting value to null (or empty string) for...
4
by: Mel | last post by:
how can i change disabled background on all form elements ?
1
by: jd | last post by:
Hi guys, I'm trying to create an HTML page that contains two frames. The bottom frame should simply be some website, but the top frame needs to have a close link to kill the window. I tried calling...
12
bilibytes
by: bilibytes | last post by:
hi, i need some help here. how can i access a static property of a subclass. i have an abstract class which will be extended... each extending class will have a static property that will...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.