View Full Version : IFRAME content problem

06-16-2007, 05:00 PM

I am trying to create a form that allow to me verify user registration details against a government database.

I have a page that exists in an iframe and is submitted via javascript controls in the parent window. This page posts some data to a remote site and then shows the results page. The problem i am having is trying to read the contents of the IFRAME once the page as been submitted.

I can read the contents before the page submit but once it has been done I get an access denied message. if the remote site is a https would that make any differance to it.

function submitform()

var surname = document.getElementById("surname").value;
var number = document.getElementById("accreditationNumber").value;

//parent.landmark.onload = function alertIframeContents(){ alert(document.getElementBuId("landmark").innerHtml); };

parent.landmark.document.form1.hiCertNumber.value = number;
parent.landmark.document.form1.hiSurname.value = surname;

setTimeout("alertIframeContents()", 2000);

function alertIframeContents()



This is the jaascript code i have been using. Is there also a better way to detect wen the remote page as loaded, because this is going to be one of my biggest problems.


06-16-2007, 06:03 PM
For security reasons, Javascript cannot access the page in a different domain.

06-16-2007, 07:18 PM
thank you for your response...

thats shame oh well i suppose i will just have to find a different way.