Page 1 of 1

change fields from outside of a iframe

Posted: Mon Mar 23, 2009 4:41 am
by srdva59
hi,
i want change some value fields fom outside of a iframe
but i receive this error:
Erro: uncaught exception: HTMLDocument.getElementById

the name of the field exist but i receive this error
how can i fix that i using the folow code:

alert parent.I1.document.getElementById("phoneNumber1");

Re: change fields from outside of a iframe

Posted: Mon Mar 23, 2009 5:23 am
by Christopher
The iframe is a separate document. You need to access the iframe and then the element in the iframe's document.

Re: change fields from outside of a iframe

Posted: Mon Mar 23, 2009 6:26 am
by eliteghost
you need to be more clear, try another method maybe

Im thinking you could just
-define what you want outside,
-set it as global,
-require it in your page that you are calling in your iframe,
-call your global variable and use it