I load some content (simple web form) to iframe (from my domain) via fancybox. And want to add valu to one input in this iframe form.
Try this:
$x("a.load_html_i").fancybox({
'type' :'iframe',
'padding' : 20,
'width' : 690,
'height' : 550,
'onComplete' : function() {
$x('#fancybox-frame input[name=input_text_0]').val($x(this).attr('title'));
}
});
where #fancybox-frame is id of iframe.
And this:
...
$x("#fancybox-frame").contents().find("input[name=input_text_0]").val($x(this).attr('title'));
...
But it’s not work.
I found a problem: jquery runs before iframe loaded. How to improve it?
adding ready not help