Christopher Almond
Christopher Almond

Reputation: 80

Auto filling in fields of an iframe and submitting the form using javascript

I need to access the below iframe with javascript to allow me to auto input a set username and set password in the form and then submit it. :

<iframe src="http://example.com" id="mainForm"></iframe>

how is this done?

Upvotes: 0

Views: 1300

Answers (1)

Diodeus - James MacFarlane
Diodeus - James MacFarlane

Reputation: 114347

The Same Origin Policy prevents you from manipulating the content of an Iframe from an different domain. This was put in place to prevent Iframed content from hijacking your privacy.

What you want cannot be done.

Upvotes: 1

Related Questions