change fields from outside of a iframe

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
srdva59
Forum Commoner
Posts: 77
Joined: Sun Feb 15, 2009 10:58 am

change fields from outside of a iframe

Post 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");
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: change fields from outside of a iframe

Post by Christopher »

The iframe is a separate document. You need to access the iframe and then the element in the iframe's document.
(#10850)
eliteghost
Forum Newbie
Posts: 6
Joined: Sun Mar 22, 2009 7:53 pm

Re: change fields from outside of a iframe

Post 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
Post Reply