Suppose: I made a page that had an IFrame on it. The IFrame's source file is a remote file. The main intension is to change the form field values of the IFrame page by running the JavaScript function I made on my page. This means that the IFrame's forms field will filled automatically. How is it possible.... Please help me.
Hi ivenms, It may not be possible purely because it is a remote location. I would attempt to get it working on a local file first, if you can make that work but it does not work on the remote page then you might be a bit stuck. Gary
Is there any option available on this wide programming field to put contents on the text field automatically ( With remote files. Not saying about the text fields of same page.) ???? ???? Please help me. Iam in deep trouble now.
Your iframe file script is included inside your page? once included, remote or not, the iframe html is displayed into the browser and DOM is accessible for read and write when available. Based on that assumption, you can change the value of displayed fields simply by accessing their value property in javascript, by setting document.getElementById('fieldiniframe').value = 'something';. You can even place in your page a button associated to a function that would put defaults in all your fields.
I tried. But it doesn't works with IFRAME... For Example: Try to make an Iframe on your page with src=http://google.com Then try to change the value of the google search text field "q" from your page. I tried and I failed to change the text field value.
well www.google.com is a page with its own headers, i do not believe in that case you can modify values from inside your page. What if the page you are including, is a body content only. I say this because i use a lot of includes on my pages and i can always change the child's values from the parents.
Iam searching for a new way to change the DOM value of a remote file with JavaScript. Still not able to make it success...
You could only do this if the iframe was on the same domain as the parent window. Since it's not, the browser will not allow you to use javascript to change input values.
i really don't see why since the value of the elements you have to change are available at the browser level, regardless remote consideration.
Use cURL, get the HTML of the page and manipulate that in your server side script and then display that. This saves a JS dependency and stops users from having the page load before the form fields are filled in.
I'm not making assumptions, I'm just giving you the facts. Just do a search on cross-domain scripting
Take a look at http://www.dyn-web.com/dhtml/iframes/ section about communication between documents. Hope this helps.
That only gives the display. Iam looking for making automated form filler. Many sites doesn't allow post or get content from other parts. This idea will not work. Iam looking for JavaScript coding. Tried it. But not worked for me.