Uploadifive does not apply on dynamically created INPUT elements -


this uploadifive setup:

inside body:

<div id="file_rows_wrapper">    <div class="file_row">       <input class="file_upload" name="file_upload" type="file" multiple="false">    </div> </div> <a href="#" onclick="add_file();">add file</a> 

while javascript part:

    $(function() {          uploadify();                  });       function uploadify() {                    <?php $timestamp = time();?>          $('.file_upload').uploadifive({             'auto'             : true,             'checkscript'      : '/files/check_exists',             'formdata'         : {                                    'timestamp' : '<?php echo $timestamp;?>',                                    'token'     : '<?php echo md5('hiall' . $timestamp);?>'                                  },             'queueid'          : 'queue',             'uploadscript'     : '/files/upload_file',             'multi'       : false,             'buttontext'  : 'upload file',          });      };    function add_file() {             var file = $('.file_row:first').clone();             file.css('margin-top', '20px');              file.fadein().appendto($('#file_rows_wrapper'));              uploadify(); } 

all works expected. "file_row" div being cloned when clicking on "add file" , choosing local file, nothing happens. there no upload. if maually copy "file_row" div more times upload works fine, more uploads @ once. doing wrong?

i think need unique id in file input have multiple instances on 1 page.


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -