How can I enable/disable a button in MultiFile?
I've added a couple lines to jQuery.MultiFile.js to enable/disable my "Upload All" button, but they don't seem to work. Initially, disabled="disabled" in the page's HTML.
To disable, I added this around line 312 (after MultiFile.n--;)
- if (MultiFile.n == 0) {
$("#btnUpload").attr("disabled", "disabled");
}
To enable, I added this around line 347 (after MultiFile.n++;)
- $("#btnUpload").attr("disabled", "");
I also tried
- $("btnUpload").removeAttr("disabled");
This doesn't work. How can I disable the button when there are no files in the list and enable as long as there is at least one?
Thanks in advance!