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!