jQuery-File-Upload icon indicating copy to clipboard operation
jQuery-File-Upload copied to clipboard

disable add file button

Open ansley-bartolome021631 opened this issue 15 years ago • 7 comments

how would i disable the add file button when there is already a file in it with maxnumberoffiles set to undefined? can anyone help me with this?

ansley-bartolome021631 avatar Dec 02 '11 03:12 ansley-bartolome021631

The following will not exactly disable the add button, but will prevent adding more than one file:

$('#fileupload').fileupload({
    maxNumberOfFiles: 1
});

blueimp avatar Dec 02 '11 03:12 blueimp

Put it in application.js, replacing this line: https://github.com/blueimp/jQuery-File-Upload/blob/master/application.js#L19

blueimp avatar Dec 02 '11 03:12 blueimp

i get it,thanks a lot....

ansley-bartolome021631 avatar Dec 02 '11 03:12 ansley-bartolome021631

i have a major problem in here,i put this plugin in a dialog box but i want that every time i close the dialog box a new instance of dialog box should appear or i want that the add file button is enable again....

ansley-bartolome021631 avatar Dec 02 '11 04:12 ansley-bartolome021631

how would i disable the add file button AFTER uploading a one file only...

ansley-bartolome021631 avatar Dec 02 '11 06:12 ansley-bartolome021631

You can try this:

$('#fileupload').bind('fileuploaddone', function (e, data) {
        var fu = $(this).data('fileupload');
        fu._disableFileInputButton();
    });

Regards

isaacsf avatar Dec 15 '11 09:12 isaacsf

thank you so much

ansley-bartolome021631 avatar Dec 16 '11 06:12 ansley-bartolome021631