Jump to content

controlling a form in an iframe with javascript


jk11uk

Recommended Posts

I'm presuming i have to use javascript, but anytyhing will do to get the job done!

 

I have a site which has an affiliate form and i need to pass data into it using javascript. I've set up a test button (the link 'tester') which should send xxxx into the firstname field. But, as you may have guessed im here for a reason and it doesnt :)

 

http://www.budgetinsuranceagents.co.za/car-insurance-quote.html

 

Could someone have a look and give me a hand?

 

The code on the link is:

<a onclick="document.frames('frameform').document.forms('MyForm').firstname.value='xxxx';" href="#">tester</a>

 

It is because Javascript isn't allowed to access an iframe from another domain:

 

http://en.wikipedia.org/wiki/Same_origin_policy

 

Your active url:

 

http://www.budgetinsuranceagents.co.za/car-insurance-quote.html

 

The iframe src:

 

http://affiliates.trafficsynergy.com/z/1047223/CD9592/

 

Javascript is denied access.

 

This helps prevent XSS attacks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.