views:

14

answers:

1

parent.document.getElementById("next").innerHTML=window.frames['hiddenframe'].document.body.innerHTML;

Error: window.frames.hiddenframe is undefined

this is the error i get. i have given an id for iframes as hiddenframe but still it isnt working.

i cant see to find my mistake please help.

A: 

You need to use the contentWindow property.

document.getElementById('hiddenframe').contentWindow.document.body.innerHTML

That will allow you to access the contents of the iframe.

The way you have it at the moment, you would be accessing the frame via the name attribute, not the ID.

Rafael
@rafael i did google up for that and due to some reason that isnt working.could my html be wrong?
djd
Hard to say, since I can't see your HTML.The code I posted above should work. If it doesn't something is wrong elsewhere.Also, this will not work at all if the content of the iframe is from a different domain. You can't access the contentWindow of an iframe if it's from another domain, as it's a security concern. See https://developer.mozilla.org/en/HTML/Element/iframe
Rafael
the content is from the same domain.have a look at my html its coded shabily. http://pastebin.com/hV288wb8my next.php php gives an output of a input form
djd