Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove upload button in Bootstrap File Input

I have this Bootstrap file input plugin which can be found here: http://plugins.krajee.com/file-basic-usage-demo

This plugin looks like as below:

enter image description here

Now what I want to do is to remove this upload button of this plugin. Does anybody know how to do this? Or does anyone already tried?

like image 474
Makudex Avatar asked Sep 06 '15 15:09

Makudex


3 Answers

You can just use these following snippets

$("#your-input-type-file-ID").fileinput({
    'showUpload': false
});
like image 191
Hanny Setiawan Avatar answered Nov 06 '22 12:11

Hanny Setiawan


Finally found the answer, by simply editing this code here from fileinput.js:

$.fn.fileinput.defaults = {
    language: 'en',
    showCaption: true,
    showPreview: true,
    showRemove: true,
    showUpload: false, // <------ just set this from true to false
    showCancel: true,
    showUploadedThumbs: true,
    // many more below
};
like image 13
Makudex Avatar answered Nov 06 '22 11:11

Makudex


You can do it in a simple way also simply write in an attribute data-show-upload="false" and it I'll work too!!

like image 6
Shakti Singh Avatar answered Nov 06 '22 10:11

Shakti Singh