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>

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.