I have a simple (main) page with a iframe within it.
The (main) page has a form, which i need to access from within iframe
From within the iframe i am trying to refer to form elements in the main page.
I have tried all of these - but with no success in Chrome browser:
top.document.getElementById('myform');
Error message: Cannot call method 'getElementById' of undefinedparent.getElementById('myform');
Error message: Object [object global] has no method 'getElementById'parent.document.myform.mytextbox.value;
Error message: Cannot read property myform of undefined.
In IE - i can simply do - works in IE:
parent.document.myform.mytextbox.value;
If it matters: I am trying this on my desktop, the html pages are not hosted in any webserver. So there is no domain as such...
Any idea? I am hoping to make it work in Firefox and also find something that works in IE, Chrome, FireFox
EDIT
I am also seeing this message (via developer tools of chrome):
Blocked a frame with origin "null" from accessing a frame with origin "null". Protocols, domains, and ports must match.
Is this what is root cause of the issue?