title: Is is possible to read form values from a page within an Iframe?
body: <p>I'm currently investigating whether it's possible to write a html/aspx page which contains an iframe which can read values entered in text boxes etc.</p>
  
  <p>Some of the knowns are:</p>
  
  <ul>
  <li>This will only need to work with IE 7/8</li>
  <li>I have no control over the pages contained in the iframe</li>
  <li>The pages in the iframe are from a different domain</li>
  </ul>
  
  <p>I've tried this with a nested page from the same domain and it works fine; I can read the value of a textbox and display it in a messagebox fine. When I try it with a page from a different domain I get an 'Access Denied' error from IE.</p>
  
  <p>For reference the code I'm using to access form elements of the page in the iframe is as follows:</p>
  
  <pre><code>var iframe = document.getElementById("myIframe");
  var textBox = iframe.contentWindow.document.getElementById("txtTest");
  alert(textBox.value);
  </code></pre>
  
  <p>I understand that this may not be possible, by design, for security reasons but just want to check first that there's no workarounds before abandoning this idea.</p>