0

I am working on a site for a client and he has a form button that when clicked will take the user to a page offering a freebie. He wants the button to be disabled until the user has clicked on an ad that is served up in an iframe.

Is something like this even possible?

I have set up a jsFiddle to show what I've done so far: http://jsfiddle.net/dL7JT/

Here is my jQuery:

$(document).ready(function() {
    $('#adslot > a').click(function() {
        $('#btnSubmit').removeAttr('disabled');
    });
});

and the HTML:

<iframe id="adslot" style="border: 0; width: 180px; height: 150px;" src="http://coinurl.com/get.php?id=19647" height="240" width="320" scrolling="no"></iframe>
<form>
    <input id="btnSubmit" type="submit" disabled="disabled" value="Submit"/>
</form>

I'm guessing it's the iFrame that is tripping me up.

Any help is much appreciated!

Cynthia
  • 5,273
  • 13
  • 42
  • 71

1 Answers1

1

For security reasons, Web browsers won't let you access an iframe's content(It is possible only if the iframe resides in the same domain as the parent page).U can perform this if its in the same domain.You could check for yourself in the below link mate... :)

Fiddle

http://jsfiddle.net/jaatA/

Nibin
  • 3,922
  • 2
  • 20
  • 38