Re: General DHTML question about ID

From: Roland Hall (nobody_at_nowhere)
Date: 02/29/04


Date: Sun, 29 Feb 2004 04:02:44 -0600


"Lithium" wrote:
: if i set an ID on a element i can reach it with window.id or id or
document.all.id
: for example
: <input type="text" id="test_input">
: reachable window.test_input or
: test_input or
: document.all.test_input
:
: but if i put a form over it -><form><input type="text"
id="test_input"></form>
: i can't reach the INPUT Element with window.test_input or direct with
test_input. -->error: test_input undefined
: only document.all.test_input works
: the same shows up with select element, or other Elements which can be sent
by form.
: why?
: i thought id is a unique identifier which can be easily reach per ID or
window.ID

document.getElementById("test_input")

: the second problem i have is putting an ID on iframe
:
: <iframe id="test_iframe"></iframe>
:
: alert (test_iframe) shows up that the ID is set..--> Object
:
: but the property test_iframe.src is undefined. alert (test_iframe.src) ->
undefined
: but document.all.test_iframe.src is defined. alert
(document.all.test_iframe.src) -> ""
:
: so what i want to say is, i can only set the src property of an iframe
with document.all.IFRAME_ID.src=..
: why not with IFRAME_ID.src;

1. You're not providing src in the iframe example above.
2. document.getElementById("test_iframe").src perhaps?

-- 
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp


Relevant Pages

  • Re: Cross domain iframe access
    ... value of the - location - property of an IFRAME that contained a page ... babyhood and "throw" even for programmers was first associated with ... sense as one doesn't break code execution unless it is indeed ...
    (comp.lang.javascript)
  • Re: method execution problem
    ... > In the Parent.html page there is a iframe. ... > parentMethod is in the Main.js file and the js file is included in the ... > if I uncomment the alert statement in the parentMethod, method executes ...
    (microsoft.public.scripting.jscript)
  • Re: Cant set IFrame background.
    ... >:I have an IFrame embedded in a form and wish to set the background color ... the same color of the form that contains the IFrame. ... Look at the source of the iframe document. ... without even the implied warranty of merchantability ...
    (microsoft.public.scripting.jscript)
  • Re: Submiting an iframe first before the main page submit is complete
    ... "Roland Hall" wrote in message ... :> "Luke Duddridge" wrote in message ... :>: iframe action. ... without even the implied warranty of merchantability ...
    (microsoft.public.scripting.jscript)
  • Re: rich text editing
    ... BTW, is it possible to have an empty iframe (withou any src property) ... because design mode needs to be run after the area loads ...
    (comp.lang.javascript)

Quantcast