2013-03-18 40 views

回答

0

試試這個,添加文件上傳HTML中的自定義按鈕,使殘疾人:

<div class="span7"> 
        <span class="fileinput-button ufloat"> 
         <span class="icon icon-plus"></span> 
         <span class="upload_txt">choose file to upload</span> 
         <input type="file" multiple="multiple" size="1"/> 
        </span> 
        <button type="submit" id="uploadBtn" class="btn-primary start"> 
         <i class="icon icon-upload"></i> 
         <span>Upload</span> 
        </button> 
        <button type="reset" id="cancelBtn" class="btn-primary cancel"> 
         <i class="icon icon-ban-circle"></i> 
         <span>cancel</span> 
        </button> 

        <!-- Adding your custom button --> 
        <button id="customBtn" disabled="true"></button> 
       </div> 

,並在您的main.js添加這個在你做過功能:

$('#fileuploadbasic').fileupload({ 
     done: function{ 
        var filess= data.files[0]; 
      var filenam = filess.name; 
      data.context.text(''); 
      $(data.context).append('<td class="name" colspan="6">'+filenam+' uploaded Success</td>'); 

// after finish upload and there are no other files to upload make 
// make custom button enabled 
if($('tbody tr.template-upload td.start').length == 0) { 
    $('#customBtn').removeAttr('disabled'); 
} 
     } 
}); 
+0

感謝您的回覆:)完成選項不起作用它我已經試過這個問題,這個選項是每次上傳完成後打開,啓用自定義按鈕後,如果我們刪除所有文件或取消上傳,它將不會禁用。如果你有另一個解決方案,請在這裏發佈 – 2013-03-19 06:46:21