window iframe form elements

M

mike

If I have an opened window called "mywin" and in that window I have an
iframe called "myiframe" and in that iframe I have a form called
"myfrm" with an element "myelem" why can't I use this:


mywin.frames['myiframe'].document.forms['myfrm'].elements['myelem'].value="Mike";

I get a error message that says:

"frames.myiframe.document.forms.myfrm.elements is null or not an
object"

mywin is defined as:

mywin = window.open( ..blah, blah, blah.... );

If I break it down in to smaller unit like:

var frm = mywin.frames['myiframe'];

and then test each part using:

if ( frm ) { alert('found'); }

then I don't get the error messages and the elements are found as if
the alert gave the form time to register the variable.

What's up with that?

Mike
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top