Hi,
I’m having trouble with uploadify on a dynamic form. It works fine, but not for the dynamic divs. Basically, I have a tree which when clicked, _ajax.php will do the following:
case 'details':
$cats = new Products();
$parent = $_GET['parent'];
if($parent){
$q = MYSQL_QUERY...;
$result = $cats->query($q);
$data = $cats->getParentCatsResult($parent);
BLAH BLAH BLAH...
echo '<div id="catDetails"><div id=<div style="height: 200px; margin-bottom: 10px; padding:10px; overflow: auto; width: 390px; border: 1px solid #e25e00;" id="queue"></div>
<input id="file_upload-'.$parent.'" name="file_upload" type="file" /></div>';
}
else {
}
break;
On the page with the tree I have (amongst all the right includes):
<script type="text/javascript">
$(document).find("a[id^='details-']").live('click', function(){
var num = this.id.split('-')[1];
alert(\\"Num: " + num); //WORKING...
$('#file_upload1-' + num).uploadify({
'uploader' : 'uploadify/uploadify.swf',
'script' : 'uploadify/upload.php',
'cancelImg' : 'uploadify/cancel.png',
'folder' : '../images/montage/',
'fileExt' : '*.jpg;*.gif;*.png',
'fileDesc' : 'Image Files',
'removeCompleted' : false,
'multi' : false,
'auto' : true,
'queueID' : 'queue',
'simUploadLimit' : 1
});
});
</script>
//With the links to load the catDetails being:
<a href="#" class="draggable" id="details-1">Click this and you can upload a file for id "1"</a>
Any help would be appreciated. Uploadify works fine if I just stick a form on that page, but not for the dynamic div. Hence my attempt at jquery to load Uploadify for the div and not onLoad.
Cheers,
Rhys