1
我想設置maxFileCount
與動態數字如果輸入字段已更改。Krajee引導文件輸入動態maxFilecount
我的代碼:
<input value="" name="check_nums" class="check_nums">
krajee的FileInput:
$(document).on('ready', function() {
$('#file-th').fileinput({
var check_nums = $(".check_nums").val();
showUploadedThumbs: false,
language: 'th',
uploadAsync: false,
maxFileCount: [check_nums],
resizePreference: 'height',
resizeImage: true,
overwriteInitial: false,
validateInitialCount: true,
showUpload: false,
allowedFileExtensions: ['jpg', 'png', 'jpeg'],
previewSettings: {
image: {width: "auto", height: "100px"},
object: {width: "213px", height: "160px"},
},
layoutTemplates: {
actions: '<div class="file-actions">\n' +
' <div class="file-footer-buttons">\n' +
' {delete}' +
' </div>\n' +
'</div>',
}
}).on("filebatchselected", function(event, files) {
});
});