I have an iframe on my page:
And I want to target a select element in it's page and set it's selected value (the name attribute has been added as that was one of the suggestions given to be able to access the frame).
I can't get the syntax correct to access the document within the frame. I've tried several suggestions such as:
but none of these seem to be able to access the document. Is this deemed as Cross Site Scripting and is that why I can't access it, or is it just the syntax I have wrong?
Thanks,
Mark
-------------------------------------------------------
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
Code:
<iframe id="myframe" name="myframe" src="[URL unfurl="true"]http://externalsite.com/page.html[/URL] "/>
I can't get the syntax correct to access the document within the frame. I've tried several suggestions such as:
Code:
var iframe = window.frames[0];
iframe.document.getElementById('TheSelect')....
Code:
myframe.document.getElementById('TheSelect')....
Thanks,
Mark
-------------------------------------------------------
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]